/
githubmirror
/
ui
Обзор
Документация
Войти
/
githubmirror
/
ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
apps/v4/examples/aria/date-picker-basic.tsx
37 строк
1 KB
shadcn
feat: aria (#11208)
17 июл 2026, 18:20
Не верифицирован
17 июл 2026, 18:20
2b89d67
Код
Авторство
О чём код?
"use client" import * as React from "react" import { getLocalTimeZone, type CalendarDate } from "@internationalized/date" import { Button } from "@/styles/aria-nova/ui/button" import { Calendar } from "@/styles/aria-nova/ui/calendar" import { Field, FieldLabel } from "@/styles/aria-nova/ui/field" import { Popover, PopoverTrigger } from "@/styles/aria-nova/ui/popover" export function DatePickerSimple() { const [date, setDate] = React.useState<CalendarDate | null>(null) return ( <Field className="mx-auto w-44"> <FieldLabel htmlFor="date-picker-simple">Date</FieldLabel> <PopoverTrigger> <Button variant="outline" id="date-picker-simple" className="justify-start font-normal" > {date ? ( date .toDate(getLocalTimeZone()) .toLocaleDateString(undefined, { dateStyle: "long" }) ) : ( <span>Pick a date</span> )} </Button> <Popover className="w-auto p-0" placement="bottom start"> <Calendar value={date} onChange={setDate} /> </Popover> </PopoverTrigger> </Field> ) }