Skip to content

Checkbox group

Groups checkboxes to select one or more options.

Email updatesSelect the messages you want to receive.
checkbox-group-demo.tsx

Installation

The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.

Composition

  • CheckboxGroup

    Owns the selected values. Lays out its children in a column.

    • CheckboxGroupLabel
    • CheckboxGroupDescription
    • CheckboxGroupItemsOptional

      Changes the layout of the choices.

      • CheckboxRepeats
    • CheckboxGroupError

Horizontal

Backup days
checkbox-group-horizontal-demo.tsx

Card grid

Put CheckboxGroupItems between the label and the error to lay out the options.

Add-ons
30 days of snapshots.
Replies in 1 hour.
SAML and OIDC.
Export every event.
checkbox-group-layout-demo.tsx

Disabled

Alert channels
checkbox-group-disabled-demo.tsx

Required

Asks for at least one option. The error shows after the first submit. Also install Form and Button.

Notification channels
checkbox-group-required-demo.tsx

API reference

vip/ui adds or changes the props below. For all other props, see React Aria CheckboxGroup (opens in a new tab).

label: ReactNode
The label of the group. Without it, pass aria-label or compose CheckboxGroupLabel.
description: ReactNode
Help text for the group, below the label.
errorMessage: string | ((validation: ValidationResult) => string)
Shown below the options when the group is invalid. Without it, the browser validation message shows. With label, description, or errorMessage, the group adds CheckboxGroupError for you.
orientation: "horizontal" | "vertical" = "vertical"
Lays out the options in a column or a wrapping row.