Skip to main content

Checkbox

Function Checkbox 

Source
pub fn Checkbox(props: CheckboxProps) -> impl IntoView
Expand description

The 2-state checkbox in its native Bulma format.

https://bulma.io/documentation/form/checkbox/

Controlled component:

  • checked is the current value (supports static bool or reactive signal).
  • update is an optional callback invoked with the next value when the user clicks.

§Required Props

  • name: impl Into<String>
    • The name attribute for this form element.
  • checked: impl Into<Signal<bool>>
    • The controlled value of this form element.

      Accepts a bool or a reactive signal.

  • children: Children
    • Label/content shown next to the checkbox.

§Optional Props

  • update: Callback<bool>
    • Optional callback to propagate changes to the parent with the new value.
  • classes: impl Into<Signal<String>>
    • Additional CSS classes to append to Bulma’s “checkbox”.
  • disabled: impl Into<Signal<bool>>
    • Disable this component.
  • test_attr: impl Into<TestAttr>
    • Optional test attribute (renders as data-* attribute) on the outer

      When provided as a &str or String, this becomes data-testid="value". You can also pass a full TestAttr to override the attribute key.