- Accordion new
- ActionSheet new
- Alert new
- Alert Dialog new
- Angle Slider new
- Autocomplete new
- Avatar new
- Badge new
- Breadcrumb new
- Button new
- Button Group new
- Card new
- Carousel new
- Checkbox new
- Clipboard new
- Collapsible new
- Color Picker new
- Date Input new
- Date Picker new
- Dialog new
- DialogCaller new
- Drawer beta
- Editable new
- Empty new
- Field new
- Fieldset new
- File Upload new
- Filters new
- Floating Panel new
- Hover Card new
- Image new
- Image Cropper new
- Input new
- Input Group new
- Json Tree View new
- Kbd new
- Listbox new
- Marquee new
- Menu new
- Number Input new
- Pagination new
- Password Input new
- PhoneField new
- Pin Input new
- Popover new
- Progress Circular new
- Progress Linear new
- Qr Code new
- Radio Group new
- Rating Group new
- Scroll Area new
- ScrollSpy new
- Segment Group new
- Select new
- Separator new
- Sidebar new
- Signature Pad new
- Skeleton new
- Slider new
- Splitter new
- Steps new
- Switch new
- Table new
- Tabs new
- Tags Input new
- Textarea new
- Timeline new
- Timer new
- Toast new
- Toc new
- Toggle new
- Toggle Group new
- Tooltip new
- Tour new
- Tree View new
- Typography new
Date Input
Vue date input for typing and parsing calendar dates with accessible, localized field behavior.
Installation
Install from the Vuzeno registry:
bunx --bun shadcn-vue@latest add https://vuzeno.com/r/date-input.json
npx shadcn-vue@latest add https://vuzeno.com/r/date-input.json
yarn dlx shadcn-vue@latest add https://vuzeno.com/r/date-input.json
pnpm dlx shadcn-vue@latest add https://vuzeno.com/r/date-input.json
Usage
<script setup lang="ts">
import { DateInput } from "@/components/ui/date-input";
</script>
<template>
<DateInput.Root>
<!-- … -->
</DateInput.Root>
</template>
Composition
DateInput.Root
├── DateInput.Label
├── DateInput.Control
│ └── DateInput.SegmentGroup
│ └── DateInput.Segment
├── DateInput.HiddenInput
├── DateInput.Context
├── DateInput.SegmentContext
└── DateInput.RootProvider
Examples
Default Value
Use the defaultValue prop with parseDate to set the initial date value.
Controlled
Use the value and onValueChange props to control the date input's value programmatically.
Root Provider
An alternative way to control the date input is to use the RootProvider component and the useDateInput hook. This way you can access the state and methods from outside the component.
Granularity
Use the granularity prop to control which date fields are displayed. Supported values are day, hour, minute, and second.
Time Only
To create a time-only input, set granularity to minute (or second) and provide a formatter that only includes time fields. Use the hourCycle prop to switch between 12 and 24 hour formats.
Range
To create a date input that allows a range selection, set the selectionMode prop to range and render two SegmentGroup components with index props set to 0 and 1.
Min and Max
Use the min and max props with parseDate to restrict the selectable date range. Dates outside this range will be marked as invalid.
Disabled
Use the disabled prop to prevent user interaction with the date input.
Read Only
Use the readOnly prop to make the date input non-editable while still being focusable.
Invalid
Use the invalid prop to indicate an error state on the date input.
Leading Zeros
Use the shouldForceLeadingZeros prop to toggle whether numeric segments are padded with a leading zero.
Localized
Use the locale prop to set the language and regional formatting of the date segments.
RTL
Set the dir prop to rtl for right-to-left language support.
With Clear Button
Use useDateInput via RootProvider to access the clearValue method and render a clear button alongside the input.
With Date Picker
Combine DateInput with DatePicker by syncing their values using onValueChange to provide both typed and calendar-based date selection.
API
See Ark UI Date Input docs for full props and examples.