Skip to content
nexubDesign System
v11.9.0

Components · Form Controls

Checkbox Field

AlphaAdded v11.1.0

A Checkbox with its label, description, aside and error; CheckboxGroupField puts several under one question.

import { CheckboxField } from '@nexub/react';
View as Markdown

Playground

Props

Paper and ribbon

$4.00
TSX
<CheckboxField label="Gift wrap" description="Paper and ribbon" aside="$4.00" />

Examples

Field

Paper and ribbon

$4.00

Group

Notify me by

Pick one or more

Carrier rates apply

States

  • Paper and ribbon

    $4.00
    default
  • Paper and ribbon

    $4.00
    invalid
  • Paper and ribbon

    $4.00
    readOnly
  • Paper and ribbon

    $4.00
    size="sm"
  • Paper and ribbon

    $4.00
    size="md"
  • Paper and ribbon

    $4.00
    size="lg"

Props

Props
PropTypeDefaultDescription
labelrequiredReact.ReactNode—Names the box; clicking it toggles.
descriptionReact.ReactNode—Help under the label and the error under the row.
errorReact.ReactNode—Help under the label and the error under the row.
asideReact.ReactNode—At the row end: a price, a count.
checkedboolean | 'indeterminate'—As Checkbox; indeterminate for a parent of a partly picked list.
CheckboxGroupField optionsrequiredCheckboxGroupOption[]—The choices, with value / onValueChange (string[]), orientation, required, name and one error for the group.
invalidboolean—Error border and aria-invalid.
readOnlyboolean—Focusable but cannot change; sets aria-readonly.
size'sm' | 'md' | 'lg'—Box size: sm 16px, md 18px (default), lg 20px.

Accessibility

Notes

  • CheckboxGroupField is a `fieldset` named by its legend; its error describes the group and marks every box invalid.