DatagridInput

Experimental. Selects records by ticking table rows; the value is an array of ids. It has no filtering or pagination.

Installation

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

Experimental. Selects records by ticking table rows; the value is an array of ids. It has no filtering or pagination.

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.
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.
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.
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.
parse(value: unknown) => NoInfer<SourceTransformValue<TRecord, TPath>>—Write transform (input value → stored value). Must return the value at `source`; `unknown` without a record.
resourcestring—Override the ambient resource.
typestring—The DOM input `type` (text inputs default to `"text"`).
validateValidator | readonly Validator[]—ra-contract validators — composed, first error wins.
choicesreadonly TChoice[]—Inline choices (records) — omit inside a `<ReferenceArrayInput>`.
classNamestring—Extra classes on the wrapper.
optionLabelReactNode—Column header for the choice column. Default the resource/source label.
optionTextOptionText<TChoice>—The display path or a formatter for a choice. Default `"name"`.
optionValueSourcePath<TChoice>—The value path on a choice. Default `"id"`.
sourceSourceProp<TRecord>—The FK-array field; supplied ambiently inside a `<ReferenceArrayInput>`.
translateChoiceboolean—Translate the choice text through the catalog.