Building blocks
Form field
Field
A label, one control, a hint and an error, wired together. A plain text input inside becomes one the agent fills by its label.
The person sees
Loading preview…
booki_version=$(npm view @booki-aui/react@latest version) &&
ui_sdk_version=$(npm view "@booki-aui/react@$booki_version" peerDependencies.@ui-sdk/core) &&
pnpm add --save-exact "@booki-aui/core@$booki_version" "@booki-aui/react@$booki_version" "@booki-aui/styles@$booki_version" \
"@ui-sdk/core@$ui_sdk_version" "@ui-sdk/react@$ui_sdk_version"Usage example
import { Field } from "@booki-aui/react"
<Field label="Supplier name" help="As on the invoice">
<input value={name} onChange={(event) => setName(event.target.value)} />
</Field>
<Field label="Invoice email" errorText={valid ? undefined : "Enter a whole email address"}>
<input type="email" value={email} onChange={(event) => setEmail(event.target.value)} />
</Field>The label names the input and the hint and error describe it. The agent finds an input named "Supplier name" and fills it with setValue.
Import from @booki-aui/react. For Booki's default styling, add import "@booki-aui/styles".