Skip to main content
BEEQ Date-picker component overview
Date pickers provide a guided way to enter dates through a calendar interface. They reduce ambiguity, prevent formatting mistakes, and make it easier to choose a single date, a range, or multiple dates depending on the task.
Use a date picker when the interface benefits from visual date selection or date validation. If users need to enter very flexible freeform dates or work with a tiny, predictable set of choices, a simpler input or select may be more appropriate.

When to use

Use date pickers when
  • Users need to select a specific date with high accuracy
  • A calendar view makes the choice faster than typing
  • You need to limit dates with min/max rules or disabled dates
  • The task involves travel dates, appointments, deadlines, or availability

Do not use date pickers when
  • The date can be entered more efficiently with a simple text field
  • The range of valid dates is so small that a select or radio group is clearer
  • Users need to enter partial, approximate, or highly flexible date values
  • The interaction would be unnecessarily heavy for the task

Patterns

Anatomy

BEEQ Date-picker component anatomy
The date picker combines a labeled field with a calendar surface that helps people choose dates accurately. Keep the field label clear, make the calendar easy to scan, and ensure the selected format matches local expectations.
PartElementDescription
1LabelDescribes what date the field is asking for (label slot)
2Date fieldThe input control people focus, type into, or use to open the calendar
3IconThe calendar affordance that signals date selection and panel access
4CalendarThe panel surface that contains the date selection interface
5Month and year controlThe heading and navigation controls used to move through months and years
6Week dayThe abbreviated day-of-week labels that structure the calendar grid
7DayAn individual selectable calendar day
8Selected dateThe currently chosen day or days shown with selected styling
9Current dayToday’s date, highlighted to help people orient themselves in the calendar

Design guidelines

1

Choose the simplest selection mode

Start with single when one date is enough. Use range only when people need both a start and end date, and use multi only for truly non-consecutive selections.
2

Keep labels and format expectations clear

Write labels that describe the task directly, such as “Arrival date” or “Travel dates”. Make sure the displayed format and first day of week match the product locale.
3

Use calendar rules to prevent bad choices

Apply min, max, isDateDisallowed, and validation states when business rules are known, so people are guided before they submit the form.
For range and most multi scenarios, showing two months at once usually makes comparison easier and reduces selection errors.
Use a calendar icon for date selection and a clock icon for time selection. The icon helps users recognise the input type before they interact with it.

Usage

Default

Use the default single type when users need to choose one date. This is the best starting point for appointments, due dates, deadlines, and similar tasks.
Users can also enter a date manually. After pressing Tab, the component formats the value and reflects it in the calendar view.Supported input formats include:
  • ISO format: 2024-05-30
  • Text format: 30 May 2024, May 30, 2024, 30 January 2024, January 1, 1970 (locale-aware)
  • Numeric format: 30/05/2024, 05-30-2024, 30.05.2024, 05.30.2024 (with day/month heuristics)
type="single" is the default. Unlike range and multi, the single-date picker also supports manual typing with locale-aware parsing.

Date range

Use type="range" when users need a start and end date. Set months="2" so both months are visible in the panel and the interval is easier to understand.
For type="range", provide a months value. Two months is the most common and easiest to compare visually.

Multiple dates

Use type="multi" when users need to pick several non-consecutive dates. Unlike the single-date picker, the panel stays open while users continue selecting.

Options

Disabled

Use disabled when the date field should not be interactive, such as when access is restricted based on user permissions or form state.

Validation states

Use validation-status when the field should show immediate visual feedback after validation.

Label with optional text

Use an optional indicator when the date adds context but is not required to complete the form.
You are responsible for the layout, styling, and accessibility of any custom content placed in the label slot.

Label with info tooltip

Combine the label slot with a tooltip when users may need a short explanation before selecting a date.

Without label

Use a label-less date picker only when the surrounding context already makes the purpose unmistakable, such as within a tightly scoped filter row or a grouped form layout.
Avoid removing the label unless nearby text or structure already provides an equivalent accessible name and clear context.

Locale

Use locale to match date formatting and calendar conventions to regional expectations.

First day of week

Use first-day-of-week to align the calendar grid with regional or business expectations.

Show outside days

By default, the calendar shows only the days of the displayed month. Enable show-outside-days when the additional context is helpful.
Avoid show-outside-days for range and multi unless the added density clearly improves the task. It can make complex selection states harder to read.

Disallowed dates

Use isDateDisallowed to make specific dates unavailable for selection. This is useful for holidays, sold-out inventory, blackout periods, or policy restrictions.

Custom display format

Use formatOptions when the selected date needs a more descriptive text format in the input field.
Use formatOptions carefully with range and multi. Long formats such as weekday: 'long' can produce unwieldy display values when multiple dates appear in the input field.

Best practices

DoUse clear, task-specific labels like “Arrival date” or “Travel dates” so users know exactly what they are selecting.

Don’tDo not overcomplicate the field label or ask for extra date information that the task does not need.

DoUse a single combined input when possible. It keeps the interaction simpler and easier to scan.

Don’tDo not split day, month, and year into separate inputs unless the use case truly requires it.

DoDisable unavailable dates when the business rules are known, instead of letting users submit invalid choices.

Don’tDo not rely on placeholder text as the only instruction or explanation for the field.

DoShow two months for range selection when comparison matters, so people can understand the interval more easily.

Don’tDo not use a heavier multi-date or range pattern when one simple date field would solve the task.

Accessibility

  • bq-date-picker is form-associated and delegates focus, so it participates in native forms and moves focus into the internal <input> element when the component receives focus.
  • The input element sets aria-disabled="true" when disabled is true, and aria-invalid="true" when validationStatus is "error".
  • The input uses aria-haspopup="dialog" and aria-controls to announce the calendar panel to assistive technologies, and aria-describedby to associate the visible label with the control when a label slot is provided.
  • The calendar panel carries role="dialog" and aria-modal="true", and is labelled via aria-labelledby matching the label slot — keeping the panel context announced correctly to screen reader users.
  • The component emits bqFocus, bqBlur, bqChange, and bqClear, which give you the hooks needed to announce validation results, react to changes, and keep form state synchronized.
  • Keyboard users can open the calendar panel with Enter or Space, navigate days with the arrow keys, and close the panel with Escape.
  • Always provide a visible label through the label slot. Without it, aria-describedby on the input has no target and the field loses its accessible name.
  • Validation states should never rely on color alone. Pair validationStatus with visible error text so screen reader users receive the same feedback as sighted users.
  • Keep locale, first-day-of-week, and display formatting aligned with user expectations so typed input and visible values remain understandable for all users.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
autofocusautofocusIf true, the input is focused on component renderbooleanundefined
clearButtonLabelclear-button-labelAccessible label for the clear buttonstring"Clear value"
disableCleardisable-clearIf true, the clear button is hiddenbooleanfalse
disableddisabledDisables the date pickerbooleanfalse
distancedistanceGap between the panel and the input triggernumber8
firstDayOfWeekfirst-day-of-weekFirst day of the week where Sunday is 00 | 1 | 2 | 3 | 4 | 5 | 61
formformID of the form the input belongs tostringundefined
formValidationMessageform-validation-messageNative validation message used when required is setstringundefined
formatOptions(property only)Intl.DateTimeFormat options used for the displayed valueDateTimeFormatOptions{ day: 'numeric', month: 'short', year: 'numeric' }
isDateDisallowed(property only)Function used to disable specific dates(date: Date) => booleanundefined
localelocaleLocale used to format and parse datesIntl.LocalesArgument"en-GB"
maxmaxLatest selectable datestringundefined
minminEarliest selectable datestringundefined
monthsmonthsNumber of months displayed for range and optionally multinumberundefined
monthsPerViewmonths-per-viewHow navigation moves through months: one month or the full visible view"single" | "months""single"
namenameName of the underlying inputstringundefined
openopenIf true, the calendar panel is visiblebooleanfalse
panelHeightpanel-heightOverrides the panel heightstring"auto"
placeholderplaceholderPlaceholder textstringundefined
placementplacementPosition of the calendar panel"top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end""bottom-end"
requiredrequiredMarks the date picker as requiredbooleanundefined
showOutsideDaysshow-outside-daysShows days outside the current monthbooleanfalse
skiddingskiddingHorizontal offset between panel and triggernumber0
strategystrategyPositioning strategy for the panel"fixed" | "absolute""fixed"
tentativetentativeTentative date used during range selectionstringundefined
typetypeSelection mode"single" | "range" | "multi""single"
validationStatusvalidation-statusValidation state of the control"none" | "error" | "warning" | "success""none"
valuevalueSelected value in ISO-8601 format; range uses start/end, multi uses space-separated datesstringundefined

Events

EventDescriptionType
bqBlurFired when the input loses focusCustomEvent<HTMLBqDatePickerElement>
bqChangeFired when the input value changes after typing, pasting, or selecting a dateCustomEvent<{ value: string; el: HTMLBqDatePickerElement }>
bqClearFired when the value is clearedCustomEvent<HTMLBqDatePickerElement>
bqFocusFired when the input receives focusCustomEvent<HTMLBqDatePickerElement>
  • In React, prefix events with on: onBqBlur, onBqChange, onBqClear, onBqFocus.
  • In Angular, use the event binding syntax: (bqBlur), (bqChange), (bqClear), (bqFocus).
  • In Vue, use the @ shorthand: @bqBlur, @bqChange, @bqClear, @bqFocus.

Methods

MethodDescriptionSignature
clear()Clears the selected valueclear() => Promise<void>

Slots

SlotDescription
labelLabel content for the field
prefixOptional prefix content inside the control
suffixOptional suffix content inside the control
clear-iconReplaces the default clear icon

Shadow parts

PartDescription
baseBase wrapper for the component
buttonNative HTML <button> element used inside the clear button
controlInput control wrapper
inputNative text input used under the hood
labelLabel slot container
prefixPrefix slot container
suffixSuffix slot container
clear-btnClear button
panelDate picker panel container
calendar__buttonCalendar navigation and day buttons
calendar__containerCalendar container
calendar__dayDay cells in the calendar grid
calendar__disabledDisabled day buttons
calendar__disallowedDays disabled via isDateDisallowed
calendar__headTable header row
calendar__headerCalendar header wrapper
calendar__headingCalendar month heading
calendar__nextNext month button
calendar__outsideOutside-month day cells
calendar__previousPrevious month button
calendar__range-endRange end date
calendar__range-innerDates inside a selected range
calendar__range-startRange start date
calendar__selectedSelected day cells
calendar__tableCalendar table element
calendar__tdCalendar body cells
calendar__thCalendar header cells
calendar__todayToday’s date cell
calendar__trCalendar rows
calendar__weekWeek rows in the calendar body

CSS custom properties

Resources

Interactive playground

Explore date picker variants, validation, locale, and panel behavior in Storybook.

Source code

Browse the component implementation, styles, and tests on GitHub.