enes

Date Picker AI

The Date Picker lets users select a date from carousel-style day, month and year columns. Its value uses the YYYY-MM-DD format, and any column can be hidden to build, for example, a month and year only picker.

Usage

<script>
	import { DatePicker } from 'fluentui-svelte';

	let value = $state('');
</script>

<DatePicker bind:value />

Date Format

Use the format prop to switch between dd/MM/yyyy and MM/dd/yyyy.

Hiding Columns

Use hideDays, hideMonths or hideYears to hide individual selector columns, for example to build a month and year only picker.

Component Props

NameTypeDefaultDescription
value bindablestring''Selected date as `YYYY-MM-DD` (matches the underlying `<input type="date">`).
format'MM/dd/yyyy' | 'dd/MM/yyyy''dd/MM/yyyy'The order the three columns are laid out in.
open bindablebooleanfalseControls the open state of the picker.
hideYearsbooleanfalseRemoves the year column.
hideMonthsbooleanfalseRemoves the month column.
hideDaysbooleanfalseRemoves the day column.
minYearnumberCurrent - 100The first year offered by the year column.
maxYearnumberCurrent + 100The last year offered by the year column.
disabledDatesDate[][]Specific days (year-month-day) that cannot be selected.
disabledMonthsDate[][]Specific months (by month + year) that cannot be selected.
disabledYearsDate[][]Specific years (by year) that cannot be selected.
ref bindableHTMLButtonElementThe DOM reference of the trigger button.
wrapperRef bindableHTMLDivElementThe DOM reference of the element wrapping the trigger and its input.
wrapperAttributesHTMLAttributesThe attributes to spread on the wrapper element.
inputElement bindableHTMLInputElementThe DOM reference of the underlying input element.
inputPropsHTMLInputAttributesHTML attributes for the underlying input element. Give it a `name` to submit the value with a form.
popupLabelstring'Choose a date'The accessible name of the popup, which is announced as a dialog.
Element Attributes (button)