• CMSnpm version

    • Overview
    • ContentBuilder
    • InviteUserForm
    • LoginForm
    • RenewPasswordForm
    • WysiwygInput
  • UInpm version

    • Overview
    • Accordion
    • AlertBubble
    • AnnouncementBar
    • Avatar
    • AvatarFileInput
    • Badge
    • Button
    • ButtonGroup
    • ButtonList
    • Calendar
    • Checkbox
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • Chip
    • ColorRadio
    • ColorRadioGroup
    • Combobox
    • DatePicker
    • DatePickerInput
    • DateRangePicker
    • DateRangePickerInput
    • DatetimePicker
    • DatetimePickerInput
    • Dialog
    • Dropdown
    • Dropzone
    • ErrorMessage
    • FileInput
    • FlashMessages
    • FormComponent
    • Icon
    • IconButton
    • ImageGallery
    • InfoBox
    • Input
    • Label
    • Layout
    • Lightbox
    • ListItem
    • Loader
    • Lozenge
    • Menu
    • Message
    • Modal
    • ✅ ModalDialog
    • ✅ ModalHeader
    • MultiCombobox
    • MultiSelect
    • Pagination
    • Paper
    • Popover
    • Radio
    • RadioGroup
    • RasterImage
    • Select
    • Switch
    • ✅ Tabs
    • TextInput
    • TextLink
    • Textarea
    • TimePicker
    • TimePickerInput
    • Toggle
    • Tooltip
    • Typography
  • Formnpm version

    • Overview
    • AvatarFileInput
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • ColorRadioGroup
    • Combobox
    • DatePickerInput
    • DateRangePickerInput
    • DatetimePickerInput
    • Dropzone
    • FileInput
    • Form
    • FormRenderer
    • GpsInput
    • MoneyInput
    • MultiCombobox
    • MultiSelect
    • NumberInput
    • PasswordInput
    • RadioGroup
    • Select
    • TextInput
    • Textarea
    • TimePickerInput
    • Toggle
  • DataGridnpm version

    • Overview
    • DataGrid
    • DataGridCustomExample
    • ExportButton
    • FilterList
    • Filters
    • FiltersButton
    • FulltextInput
    • HiddenColumns
    • HiddenColumnsButton
    • Pagination
    • RowCounts
    • RowsPerPageSelect
    • SelectedRowsToolbar
    • TableV2
    • ToolbarControl
    • ToolbarCustoms
    • ToolbarTabs
  • Wysiwygnpm version

    • Overview
  • Resizernpm version

    • Overview
  • Routernpm version

    • Overview
  • Corenpm version

    • Overview
  • Core-Reactnpm version

    • Overview
  • DnDnpm version

    • Overview
  • Stylesnpm version

    • Overview
  • Localizenpm version

    • Overview
  • Analyticsnpm version

    • Overview
  • Datepickernpm version

    • Overview
  • Icons-generatornpm version

    • Overview
  • Smart-addressnpm version

    • Overview
  • E2Enpm version

    • Overview
  • E2E-Playwrightnpm version

    • Overview
View source on GitLab

DateRangePickerInput

Text input with a range-calendar popover for picking a start/end date. The value is a controlled formatted string.

When to use

Use @uxf/ui/date-range-picker-input as a standalone, controlled range field outside a form. Inside a @uxf/form form use @uxf/form/date-range-picker-input instead — the form twin wires the field into react-hook-form (registration, range validation, isDisabled/isReadOnly from the form context) and delegates rendering to this component.

For the bare range popover without an input, use DateRangePicker. For a single date, use DatePickerInput.

Usage

"use client";

import { DateRangePickerInput } from "@uxf/ui/date-range-picker-input";
import React, { useState } from "react";

export function BasicDateRangePickerInput() {
    const [range, setRange] = useState<string | null>(null);

    return <DateRangePickerInput isClearable label="Date range" name="date-range" onChange={setRange} value={range} />;
}

Value format

The controlled value is a single display string of the form "D. M. YYYY – D. M. YYYY" (the two dates joined by SEPARATOR, " – "), or null when empty. On selection the component formats both dates with DISPLAY_DATE_FORMAT ("D. M. YYYY") and emits the joined string via onChange. Note this differs from DatePickerInput, whose value is an ISO YYYY-MM-DD string.

Props

Picker-specific props:

PropTypeDefaultDescription
valuestring | null—Required. Formatted range string "D. M. YYYY – D. M. YYYY" (controlled).
onChange(value: string | null, event?) => void—Required. Receives the new formatted range string.
namestring—Required. Field name.
minDateDate—Earliest selectable date.
maxDateDate—Latest selectable date.
minSelectedDaysnumber—Minimum length of the range, in days.
exactSelectedDaysnumber—Locks the range to an exact number of days.
numberOfMonthsnumber1Number of months shown side by side in the popover.
datesConfigDatesConfig[]—Per-date flags / disabled groups passed to the popover.
bottomContentReactNode—Arbitrary JSX rendered below the calendar grid.
triggerElementReactNodecalendar IconElement in the input that toggles the popover.
placeholderstring—Input placeholder.
styleCSSProperties—Inline style applied to the popover content.
unavailableDatesDate[]—Deprecated. Blocked dates; prefer datesConfig with isDisabled.

Inherited input-field props (from the shared input-with-popover base): label, helperText, hiddenLabel, id, form, size, variant, isClearable, isDisabled, isReadOnly, isInvalid, isRequired, isFocused, leftAddon, leftElement, rightAddon, rightElement, popoverPlacement, popoverStrategy, onBlur, onFocus.

Variants & states

  • size: small, default, large.
  • variant: default.
  • States: isDisabled and isReadOnly both disable the popover; isInvalid shows the error style (pair with helperText); isRequired marks the field; isClearable shows a remove button once a value is set; isFocused forces the focused style.

Requirements

Client component ("use client"). Import the required stylesheets once in your global CSS (the range popover reuses the single-date picker stylesheet):

@import url("@uxf/ui/css/icon.css");
@import url("@uxf/ui/css/button.css");
@import url("@uxf/ui/css/calendar.css");
@import url("@uxf/ui/css/date-picker.css");
@import url("@uxf/ui/css/date-range-picker.css");
@import url("@uxf/ui/css/input-with-popover.css");

Also requires the global @uxf/ui token layer, set up once per app — see @uxf/ui setup.

Default
Open in new tab
Sizes
Open in new tab
States
Open in new tab