About
DateInput lets the user type or pick a date from a calendar popover. Use it for scheduling, deadlines, booking dates, or any form field that needs a specific calendar date. Astryx by Meta. Source: https://astryx.atmeta.com/components/DateInput
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Date Input to your project and fits it to your theme.
Code
How Astryx Date Input is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
'use client';
/* Copyright (c) 2026 Meta Platforms, Inc. See the MIT notice in astryx-date-input.tsx. */
import '@/components/ui/astryx-date-input-utils/astryx-preview.css';
import '@astryxdesign/theme-neutral/fonts.css';
import {useSyncExternalStore} from 'react';
import {Theme} from '@astryxdesign/core/theme';
import {neutralTheme} from '@astryxdesign/theme-neutral/built';
import {useState} from 'react';
import {DateInput} from '@/components/ui/astryx-date-input';
import {Stack} from '@astryxdesign/core/Layout';
type DateString =
`${number}${number}${number}${number}-${number}${number}-${number}${number}`;
function OfficialSample() {
const [date, setDate] = useState<DateString | undefined>(undefined);
return (
<Stack
direction="vertical"
width="100%"
style={{minWidth: 0, maxWidth: 400, marginBlockEnd: 'max(0px, calc(690px - 100dvh))'}}>
<DateInput
label="Start date"
placeholder="Select a date"
value={date}
onChange={setDate}
hasClear
/>
</Stack>
);
}
function readPreviewMode() {
const {classList} = document.documentElement;
return classList.contains('dark') ? 'dark' : 'light';
}
function subscribeToPreviewMode(callback: () => void) {
const observer = new MutationObserver(callback);
observer.observe(document.documentElement, {attributes: true, attributeFilter: ['class']});
return () => observer.disconnect();
}
export default function Demo() {
const mode = useSyncExternalStore(subscribeToPreviewMode, readPreviewMode, () => 'light' as const);
return (
<Theme theme={neutralTheme} mode={mode}>
<div className="astryx-demo">
<div className="astryx-demo-content" data-centered style={{maxWidth: 400}}>
<OfficialSample />
</div>
</div>
</Theme>
);
}















