GitHubGitHub
← All widgets
Controls / widget

Time range selector

Keyboard-roving presets plus a complete custom date-time flow.

LivePresetCustom
<TimeRangeSelector bind:value onchange={setRange} />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { TimeRangeSelector } from '@chanrg/4ui';<TimeRangeSelector bind:value onchange={setRange} />

API reference

Props

PropTypeDefaultDescription
presetsTimeRangePreset[]neutral defaultsCaller-controlled range choices.
onchange(range) => voidEmits a normalized range.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Preset buttons use radio semantics and roving keyboard focus.

Dependencies

No runtime component dependencies.