UNPKG

@mitcsutt/kiln-forms

Version:

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

32 lines (31 loc) • 1.06 kB
import { type ReactNode } from 'react'; import type { ScopeNamesProps } from '../internal/types.js'; export interface FormSentenceProps extends ScopeNamesProps { /** The group's name (a visually hidden legend), e.g. "Reading goal". */ label: string; children: ReactNode; } /** * A short form written as a sentence, with its fields inline and its errors listed underneath. * * @remarks * `FormSentence` sets fields inside a sentence. Each field's label is hidden visually but kept for * screen readers, and errors are listed below the sentence rather than breaking it, each linked to * its field. * * @example In a schema * Text between fields is a `text` content node: * * ```json * { * "layout": "sentence", * "label": "Departure reminder", * "children": [ * { "content": "text", "text": "Remind me at " }, * { "kind": "time", "name": "time", "label": "Time" }, * { "content": "text", "text": "." } * ] * } * ``` */ export declare function FormSentence(props: FormSentenceProps): import("react").JSX.Element;