mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-27 14:44:12 +00:00
65 lines
2.0 KiB
TypeScript
65 lines
2.0 KiB
TypeScript
import { Button } from "@/examples/base/ui/button"
|
|
import {
|
|
Field,
|
|
FieldDescription,
|
|
FieldGroup,
|
|
FieldLabel,
|
|
} from "@/examples/base/ui/field"
|
|
import { Input } from "@/examples/base/ui/input"
|
|
import {
|
|
Select,
|
|
SelectContent,
|
|
SelectItem,
|
|
SelectTrigger,
|
|
SelectValue,
|
|
} from "@/examples/base/ui/select"
|
|
|
|
export function InputForm() {
|
|
return (
|
|
<form className="w-full">
|
|
<FieldGroup>
|
|
<Field>
|
|
<FieldLabel htmlFor="form-name">Name</FieldLabel>
|
|
<Input id="form-name" type="text" placeholder="John Doe" />
|
|
</Field>
|
|
<Field>
|
|
<FieldLabel htmlFor="form-email">Email</FieldLabel>
|
|
<Input id="form-email" type="email" placeholder="john@example.com" />
|
|
<FieldDescription>
|
|
We'll never share your email with anyone.
|
|
</FieldDescription>
|
|
</Field>
|
|
<div className="grid grid-cols-2 gap-4">
|
|
<Field>
|
|
<FieldLabel htmlFor="form-phone">Phone</FieldLabel>
|
|
<Input id="form-phone" type="tel" placeholder="+1 (555) 123-4567" />
|
|
</Field>
|
|
<Field>
|
|
<FieldLabel htmlFor="form-country">Country</FieldLabel>
|
|
<Select defaultValue="us">
|
|
<SelectTrigger id="form-country">
|
|
<SelectValue />
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectItem value="us">United States</SelectItem>
|
|
<SelectItem value="uk">United Kingdom</SelectItem>
|
|
<SelectItem value="ca">Canada</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
</Field>
|
|
</div>
|
|
<Field>
|
|
<FieldLabel htmlFor="form-address">Address</FieldLabel>
|
|
<Input id="form-address" type="text" placeholder="123 Main St" />
|
|
</Field>
|
|
<Field orientation="horizontal">
|
|
<Button type="button" variant="outline">
|
|
Cancel
|
|
</Button>
|
|
<Button type="submit">Submit</Button>
|
|
</Field>
|
|
</FieldGroup>
|
|
</form>
|
|
)
|
|
}
|