/
githubmirror
/
ui
Обзор
Документация
Войти
/
githubmirror
/
ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
apps/v4/examples/base/input-form.tsx
79 строк
2 KB
shadcn
fix: refactor styles (#10190)
26 мар 2026, 13:36
Не верифицирован
26 мар 2026, 13:36
7d718dd
Код
Авторство
О чём код?
import { Button } from "@/styles/base-nova/ui/button" import { Field, FieldDescription, FieldGroup, FieldLabel, } from "@/styles/base-nova/ui/field" import { Input } from "@/styles/base-nova/ui/input" import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, } from "@/styles/base-nova/ui/select" export function InputForm() { const countries = [ { label: "United States", value: "us" }, { label: "United Kingdom", value: "uk" }, { label: "Canada", value: "ca" }, ] return ( <form className="w-full max-w-sm"> <FieldGroup> <Field> <FieldLabel htmlFor="form-name">Name</FieldLabel> <Input id="form-name" type="text" placeholder="Evil Rabbit" required /> </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 items={countries} defaultValue="us"> <SelectTrigger id="form-country"> <SelectValue /> </SelectTrigger> <SelectContent> <SelectGroup> {countries.map((country) => ( <SelectItem key={country.value} value={country.value}> {country.label} </SelectItem> ))} </SelectGroup> </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> ) }