EditLive
An <Edit> that refreshes the record on changes and reconnects. Holds incoming changes while the form has unsaved edits, then refetches once it is saved or reset. Needs a realtime data provider.
Installation
pnpm dlx shadcn@latest add @chelone/edit-liveLoading preview…
An <Edit> that refreshes the record on changes and reconnects. Holds incoming changes while the form has unsaved edits, then refetches once it is saved or reset. Needs a realtime data provider.
See the realtime guide for provider setup and usage.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| actions | ReactNode | — | Header actions (show/delete buttons); nothing by default. |
| children | ReactNode | — | |
| className | string | — | |
| component | ElementType<any, keyof IntrinsicElements> | — | |
| id | Identifier | — | Override the record id (defaults to the `:id` route param). |
| onSuccess | (record: TRecord) => void | Promise<void> | — | Runs after a successful save with the SERVER record, post-reconciliation. |
| resource | string | — | Override the ambient resource (defaults to the `<Resource>` context). |
| sanitizeEmptyValues | boolean | — | ra parity: nullify/strip empty TOP-LEVEL values before save. Default false. |
| schema | StandardSchemaV1<Partial<TRecord>, unknown> | — | Resource schema (zod or any Standard Schema) — wired as the default form validator by the submit pipeline (T2). |
| title | ReactNode | — | Header title. A string/element renders as an `<h2>`; `false` omits it. |
| validate | FormLevelValidate<Partial<TRecord>> | — | Form-level validate fn (ra contract) — consumed by the submit pipeline (T2). |