Skip to content
Guides
Navigation
Feedback
Overlays
Layout
Data Display
Forms
.md

Forms

date-picker

Input-style button that opens a calendar popover. Single date or range, min/max, keyboard navigation, localized month and day names, submits Y-m-d with the form.

Submitted value: none yet

Installation

php artisan ui:add date-picker

Usage

<x-ui.date-picker name="due_at" placeholder="Pick a date" />

{{-- Initial value, limits, Monday as the first day of the week --}}
<x-ui.date-picker name="due_at" value="2026-12-01" min="2026-11-01"
    max="2027-01-31" week-starts-on="1" />

{{-- Range: submits one value, "2026-12-01,2026-12-07" --}}
<x-ui.date-picker name="stay" mode="range" />

{{-- wire:model and x-model go to the hidden input --}}
<x-ui.date-picker wire:model="dueAt" />

<script>
    document.querySelector('[name="due_at"]').addEventListener('change', (event) => {
        console.log(event.target.value); // "2026-12-01"
    });
</script>

Ships its own inline <script>; no JS dependencies. A hidden input named name holds Y-m-d (with mode="range", one value start,end) and fires bubbling input and change events, so wire:model, x-model and other attributes pass through to it; id and aria-* go to the trigger. Props: value, min, max, placeholder, disabled, week-starts-on (0-6), locale (defaults to the page's <html lang>), previous-label, next-label.

Props

Every prop with its default. Pass any of them as attributes, using : to bind a PHP value.

@props([
    'name' => null,
    'value' => null,
    'mode' => 'single',
    'placeholder' => 'Pick a date',
    'min' => null,
    'max' => null,
    'disabled' => false,
    'locale' => null,
    'weekStartsOn' => 0,
    'previousLabel' => 'Previous month',
    'nextLabel' => 'Next month',
])