Tessera
GitHub

Forms

Checkbox

Turns an option on or off as part of a form that is saved later. For instant on/off settings use Switch.

  • Label is a short statement of what becomes true.
  • indeterminate for a parent whose children are partly selected.

When to use

Turn one option on or off as part of a form that's saved later; agree to terms.

Use something else

Setting that applies immediately → Switch. One choice from a set → Radio. Several related options → CheckboxGroup.

Do

  • Write the label as what becomes true (“Notify the assignee”).
  • Use indeterminate for a parent with partly selected children.

Don't

  • Don't use negative labels (“Don't send email”).
  • Don't use a checkbox to trigger an action.

Props

PropType
checkedboolean
defaultCheckedboolean
indeterminateboolean
onChange(e: any) => void; disabled?: boolean; children?: React.ReactNode; className?: string

Use

const { Checkbox } = window.Tessera;
const el = React.createElement(Checkbox, { /* props */ });