FSAI Design System
Components

Date Input

Form-friendly date picker field built from a Popover trigger and DateSelector.

Overview

DateInput is the standard date field component used in forms, filters, and scheduling UI.

It composes:

  • Label
  • Popover
  • DateSelector
  • FieldError

Use DateInput when you want a normal field-style date picker with a trigger button and dropdown calendar.

Use DateSelector directly when you need a custom trigger or custom popover layout.

Basic Usage

<DateInput
  label="Start Date"
  value={startDate}
  onChange={setStartDate}
/>

With react-hook-form

<Controller
  control={control}
  name="startDate"
  render={({ field }) => (
    <DateInput
      label="Start Date"
      value={field.value}
      onChange={field.onChange}
      onBlur={field.onBlur}
      error={errors.startDate?.message}
    />
  )}
/>

This is the common pattern used in project forms.

Date Direction

Use direction to limit the selectable date range:

  • future
  • past
  • both
<DateInput
  value={startDate}
  onChange={setStartDate}
  direction="future"
/>

Important Date Parsing Behavior

DateInput accepts Date, timestamp-like values, and strings.

A YYYY-MM-DD string is parsed as a local calendar date rather than a UTC midnight value. This matters for forms and filters that store date-only values and should not shift because of timezone conversion.

Props

PropTypeDefaultDescription
valueDate | string | number | nullCurrent date value.
onChange(date: Date) => voidRequired. Called when a date is selected.
onBlur() => voidBlur handler, usually for form integration.
disabledbooleanfalseDisables interaction.
isLoadingbooleanfalseShows a loading skeleton inside the trigger.
labelstringField label.
formatStringstring'dd MMM yyyy'Display format for the selected date.
classNamestring''Additional trigger classes.
placeholderstring'Select Date'Placeholder text when no date is selected.
iconIconName'CalendarDays'Trigger icon.
size'md' | 'sm''md'Trigger size.
errorstringInline field error text.
direction'future' | 'past' | 'both''both'Selectable date direction constraint.

Brand Dashboard Usage

PatternPathNotes
Project date fieldsfsai/apps/brand-dashboard/src/pages/Projects/components/CreateProjectModal.tsxStandard Controller-driven field usage.
Analytics or tracking filtersfsai/apps/brand-dashboard/src/pages/LinkTracking/components/LinkTrackingPanel.tsxDate-range filtering UI.
Due date selectionfsai/apps/brand-dashboard/src/pages/Learning/components/DueDatePicker.tsxDate field paired with TimeSelect.
Shared table filtersfsai/packages/shared-ui/src/components/DataTable/toolbar/Filters.tsxStores date-only values for filtering.

Guidelines

  • Do use DateInput for ordinary date fields in forms and filters
  • Do use Controller in react-hook-form
  • Do use DateSelector directly only when you need custom trigger or popover composition
  • Don't treat DateInput like a native text input; its ref points to the popover button trigger

On this page