Object Field
InputMITNested object form section with grouped fields and collapsible state.
bun add @otfdashkit/ui
Preview
Object FieldInput
Loading Storybook preview…
Code
@otfdashkit/uiimport { Field, ObjectField, Input } from '@otfdashkit/ui'
export function Example() {
return (
<div className="flex flex-col gap-4 max-w-md">
<ObjectField title="Billing Address" description="Your invoice will be sent here." collapsible>
<Field label="Street" required><Input placeholder="123 Main St" /></Field>
<Field label="City" required><Input placeholder="San Francisco" /></Field>
</ObjectField>
<ObjectField title="Shipping Address" collapsible defaultOpen={false}>
<Field label="Street"><Input placeholder="123 Main St" /></Field>
</ObjectField>
</div>
)
}
Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.
Props
Props declared in the ObjectField source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| childrenrequired | ReactNode | ||
| titlerequired | string | ||
| className | string | ||
| collapsible | boolean | false | |
| defaultOpen | boolean | true | |
| description | string |