UNPKG

@mitcsutt/kiln-forms

Version:

Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui

39 lines (38 loc) • 1.44 kB
import { type ReactNode } from 'react'; import type { HeadingLevel } from '../internal/types.js'; export interface FormReviewProps { title?: ReactNode; /** Default 3. */ headingLevel?: HeadingLevel; /** * The wizard step this block reviews. With it, an Edit button calls `onEdit(step)` — or, inside * `FormSteps` without `onEdit`, goes back to that step. */ step?: string; onEdit?: (step: string) => void; /** * The Edit button's text. Default `messages.edit` ("Edit"); with a `title`, the button is also * described by it, so several Edit buttons stay distinguishable. */ editLabel?: string; /** * Clamp each value to about this many lines, with a "Show more" toggle, for answers that run * long. Values that fit show no toggle. Default: the `Form`'s `viewLines`, else no clamp. */ viewLines?: number; children: ReactNode; } /** * The same fields, rendered as a list of answers to check. For the last step of a wizard. * * @remarks * `FormReview` renders the fields inside it in view mode: a description list of labels and * formatted values. Reuse the JSX (or schema subtree) of earlier steps to build a "check your * answers" step. * * @example In a schema * ```json * { "layout": "review", "title": "Your booking", "children": [] } * ``` */ export declare function FormReview(props: FormReviewProps): import("react").JSX.Element;