Checkbox

An 18px box: raised and ringed, ink when checked, with a check that draws itself.

View source
import { Checkbox, CheckboxGroup } from "@logicplanes/kaeso-ui";

Props

  • aria-describedby
    string

    The ids of the elements that describe it.

  • aria-label
    string

    The accessible name, for when there is no visible label.

  • aria-labelledby
    string

    Names the box by other text, such as the first line of a row whose label holds more.

  • checked
    boolean

    Whether it is checked, when you control it.

  • defaultChecked
    boolean

    Whether it starts checked, when the component keeps its own state.

  • description
    ReactNode

    One sentence of help under the label.

  • disabled
    boolean

    Turns it off: it can't be used, and it looks dimmed.

  • id
    string

    The id of the control, so a label elsewhere can point to it.

  • indeterminate
    boolean

    Shows a dash: some, but not all, of a group is checked.

  • invalid
    boolean

    Shows it as invalid; inside a Field with error, it is invalid on its own and reads the message with it.

  • label
    ReactNode

    The label; the whole row becomes the target.

  • name
    string

    The field name the value is sent under in a form.

  • onCheckedChange
    ((checked: boolean) => void)

    Called with the new state when it is checked or unchecked.

  • parent
    boolean

    Makes it the select-all box of a CheckboxGroup: checked when every value in the group's allValues is, a dash when some are, and checking it checks them all.

  • readOnly
    boolean

    Shows the value without letting people change it.

  • required
    boolean

    Marks it as required in a form.

  • value
    string

    The value sent with the form, and the value in a CheckboxGroup.

  • variant
    "default" | "card" = default

    The box with its label beside it, or a row of a settings group with the box at the end (card), as the rows of a CheckboxGroup with variant="cards" are.