CheckboxGroupInput

A group of checkboxes for choosing several values.

Installation

pnpm dlx shadcn@latest add @chelone/checkbox-group-input
Loading preview…

A group of checkboxes for choosing several values.

Props

PropTypeDefaultDescription
alwaysOnboolean—As a `<FilterForm>`/`<FilterButton>` filter: always shown, never in the add-filter menu. Read off the element by the filter layer, never by the input.
choicesreadonly string | TChoice[]—Inline choices (`{ id, name }[]` or `string[]`). Omitted under a reference wrapper.
defaultValueNoInfer<SourceValue<TRecord, TPath>>—Input-level default, ra precedence (seeds only into an untouched hole). Typed as the value at `source`; `unknown` without a record.
disabledboolean—Native disabled state.
disableValueSourcePath<TChoice>—The disabled-flag path. Default `disabled`.
format(value: unknown) => unknown—
helperTextReactNode—Helper text rendered below the input; a string is translated.
idstring—Explicit element id; a generated `useId` value is used otherwise.
isRequiredboolean—Forces the required marker; ORed with `required()` detection on `validate`.
labelReactNode—The input label. A string is translated; a ReactNode renders as-is; `false` (or `""`) renders no label.
labelPlacement"end" | "start" | "top" | "bottom"—
namestring—Legacy field-name alias (ra parity); the wiring uses `source`.
onBlur(event: unknown) => void—Chained AFTER the blur is recorded.
onChange(eventOrValue: unknown) => void—Chained AFTER the parsed value is written to the form.
optionsCheckboxProps & RefAttributes<HTMLButtonElement>—
optionTextOptionText<TChoice>—The display path (dot/bracket) or a formatter over the whole choice. Default `name`.
optionValueSourcePath<TChoice>—The value path. Default `id`.
parse(value: unknown) => NoInfer<SourceTransformValue<TRecord, TPath>>—Write transform (input value → stored value). Must return the value at `source`; `unknown` without a record.
readOnlyboolean—Native read-only state.
resourcestring—Override the ambient resource (used to resolve the default label key).
rowboolean—
sourceTPath—The field path RELATIVE to the ambient source scope.
translateChoiceboolean—Translate a string-path label.
typestring—The DOM input `type` (text inputs default to `"text"`).
validateValidator | readonly Validator[]—ra-contract validators — composed, first error wins.