FormExample() — ui Function Reference
Architecture documentation for the FormExample() function in preview.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD aad4d210_9cbc_5e97_dde7_68c56d668ad1["FormExample()"] f02a92c6_0fdc_9231_5419_752092d638ff["preview.tsx"] aad4d210_9cbc_5e97_dde7_68c56d668ad1 -->|defined in| f02a92c6_0fdc_9231_5419_752092d638ff style aad4d210_9cbc_5e97_dde7_68c56d668ad1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/v4/registry/bases/base/blocks/preview.tsx lines 965–1124
function FormExample() {
const monthItems = [
{ label: "MM", value: null },
{ label: "01", value: "01" },
{ label: "02", value: "02" },
{ label: "03", value: "03" },
{ label: "04", value: "04" },
{ label: "05", value: "05" },
{ label: "06", value: "06" },
{ label: "07", value: "07" },
{ label: "08", value: "08" },
{ label: "09", value: "09" },
{ label: "10", value: "10" },
{ label: "11", value: "11" },
{ label: "12", value: "12" },
]
const yearItems = [
{ label: "YYYY", value: null },
{ label: "2024", value: "2024" },
{ label: "2025", value: "2025" },
{ label: "2026", value: "2026" },
{ label: "2027", value: "2027" },
{ label: "2028", value: "2028" },
{ label: "2029", value: "2029" },
]
return (
<Example title="Complex Form">
<Card className="w-full max-w-md">
<CardHeader>
<CardTitle>Payment Method</CardTitle>
<CardDescription>
All transactions are secure and encrypted
</CardDescription>
</CardHeader>
<CardContent>
<form>
<FieldGroup>
<FieldSet>
<FieldGroup>
<Field>
<FieldLabel htmlFor="checkout-7j9-card-name-43j">
Name on Card
</FieldLabel>
<Input
id="checkout-7j9-card-name-43j"
placeholder="John Doe"
required
/>
</Field>
<div className="grid grid-cols-3 gap-4">
<Field className="col-span-2">
<FieldLabel htmlFor="checkout-7j9-card-number-uw1">
Card Number
</FieldLabel>
<Input
id="checkout-7j9-card-number-uw1"
placeholder="1234 5678 9012 3456"
required
/>
<FieldDescription>
Enter your 16-digit number.
</FieldDescription>
</Field>
<Field className="col-span-1">
<FieldLabel htmlFor="checkout-7j9-cvv">CVV</FieldLabel>
<Input id="checkout-7j9-cvv" placeholder="123" required />
</Field>
</div>
<div className="grid grid-cols-2 gap-4">
<Field>
<FieldLabel htmlFor="checkout-7j9-exp-month-ts6">
Month
</FieldLabel>
<Select items={monthItems} defaultValue={null}>
<SelectTrigger id="checkout-7j9-exp-month-ts6">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectGroup>
Domain
Subdomains
Source
Frequently Asked Questions
What does FormExample() do?
FormExample() is a function in the ui codebase, defined in apps/v4/registry/bases/base/blocks/preview.tsx.
Where is FormExample() defined?
FormExample() is defined in apps/v4/registry/bases/base/blocks/preview.tsx at line 965.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free