Skip to content

Date Range Field

Edit two date endpoints while preserving incomplete and invalid drafts.

Usage

Basic

Use the smallest complete composition and let it own its initial value.

Deployment windowAug 22–25, 2026

Bounded

Reject values outside the configured minimum and maximum.

Deployment windowSep 8–18, 2026

Controlled

Let the parent own the current value and apply accepted changes back to the component.

Deployment windowAug 22–25, 2026

API

Vue package: @sectile/vue/temporal/date-range-field

Components
  • DateRangeFieldRoot
  • DateRangeFieldStartInput
  • DateRangeFieldEndInput

Props

DateRangeFieldRootProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

defaultValue

Initial value used when the component owns its state.

disabled

Whether interaction is unavailable.

endLabel

Accessible label for the range end input.

modelValue

Current value when state is controlled by the parent.

policies

Behavior policies that customize validation, movement, or selection.

readonly

Whether the value can be inspected but not changed.

required

Whether the control must contain a valid value before submission.

startLabel

Accessible label for the range start input.

Slots

DateRangeFieldRootSlotProps

active

Whether this item is currently active.

disabled

Whether interaction is unavailable.

endText

Formatted text for the range end value.

readonly

Whether the value can be inspected but not changed.

startText

Formatted text for the range start value.

value

Current value exposed by this contract.

Events

DateRangeFieldRoot

update:modelValue

Emitted when the component requests a new controlled value.

Other types

DateRangeFieldValueChangeHandler

ts
type DateRangeFieldValueChangeHandler = (value: DateRange | null) => void

DateRange

NameTypeRequired
startDateValueYes
endDateValueYes

Parts

Shared scope: [data-scope="date-range-field"]. Combine it with a part selector to keep styles local to this component.

PartSelectorRoleExtra attributes
root[data-part="root"]Defines the component boundary and owns its composed parts.
start-input[data-part="start-input"]Edits the start value.
end-input[data-part="end-input"]Edits the end value.

Keyboard interaction

KeyBehavior
Arrow Up / Arrow DownIncrement or decrement the active value segment.
EnterCommit the draft value.
EscapeCancel the draft and restore the accepted value.

Accessibility

Separate labeled start and end inputs expose a single ordered range without hiding endpoint errors.

Released under the MIT License.