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-inputLoading preview…
Experimental. Selects records by ticking table rows; the value is an array of ids. It has no filtering or pagination.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| alwaysOn | boolean | — | 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. |
| defaultValue | NoInfer<SourceValue<TRecord, TPath>> | — | Input-level default, ra precedence (seeds only into an untouched hole). Typed as the value at `source`; `unknown` without a record. |
| helperText | ReactNode | — | Helper text rendered below the input; a string is translated. |
| id | string | — | Explicit element id; a generated `useId` value is used otherwise. |
| isRequired | boolean | — | Forces the required marker; ORed with `required()` detection on `validate`. |
| label | ReactNode | — | The input label. A string is translated; a ReactNode renders as-is; `false` (or `""`) renders no label. |
| name | string | — | 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. |
| resource | string | — | Override the ambient resource. |
| type | string | — | The DOM input `type` (text inputs default to `"text"`). |
| validate | Validator | readonly Validator[] | — | ra-contract validators — composed, first error wins. |
| choices | readonly TChoice[] | — | Inline choices (records) — omit inside a `<ReferenceArrayInput>`. |
| className | string | — | Extra classes on the wrapper. |
| optionLabel | ReactNode | — | Column header for the choice column. Default the resource/source label. |
| optionText | OptionText<TChoice> | — | The display path or a formatter for a choice. Default `"name"`. |
| optionValue | SourcePath<TChoice> | — | The value path on a choice. Default `"id"`. |
| source | SourceProp<TRecord> | — | The FK-array field; supplied ambiently inside a `<ReferenceArrayInput>`. |
| translateChoice | boolean | — | Translate the choice text through the catalog. |