Skip to content

Settings

Date picker input

A text field with a calendar popover, tolerant of loose typing.
Available
Ports as-is

Examples

Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.

Date picker input

Rendered live from Storybook

Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.

Props

The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.

PropTypeDefaultDescription
valueDate—Currently selected date. Undefined renders the placeholder.
onChange*(value: Date | undefined) => void—Fires on calendar select, on Enter, and on blur once the typed text parses.
disabled(date: Date) => boolean—Matcher for days the calendar refuses. Same signature as the original.
placeholderstring"DD-MM-YYYY"Undocumented — add TSDoc to the prop in the library.
openboolean—Controlled dropdown state. Leave undefined to let the field manage its own open/closed via focus, and use `defaultOpen` to pin a story to the open state.
defaultOpenbooleanfalseInitial dropdown state when uncontrolled.
onOpenChange(open: boolean) => void—Undocumented — add TSDoc to the prop in the library.
nowDateDATE_PICKER_INPUT_DEFAULT_NOWReference "today" — feeds both the calendar's today marker and the parser. Fixed by default so the component never reads the machine clock.
defaultMonthDate—Month the calendar opens on when nothing is selected. Defaults to `now`.
usePortalbooleantrueThe app always portals the dropdown to `document.body` with fixed coordinates. Set false to render it absolutely inside the field instead — needed when the field lives in a scrolling gallery or a docs block, where an escaped portal floats over unrelated content.
autoFocusCalendarbooleantrueSteal focus into the calendar when it opens. Off is useful for static stories.
classNamestring—Undocumented — add TSDoc to the prop in the library.

Reference

Transcribed from the component audit. If this disagrees with the source, the source is right.

Source
src/components/settings/DatePickerInput.tsx
Portability
Copies across unchanged — only the utils import path moves.
Notes
Takes a now value and a defaultOpen for a static view.