Skip to content

Time Range Card

A start and an end on one day. Duration chips set the end from the start, moving the start keeps the length, and the note under them says the length in words. An end at or before the start is flagged on the field and Apply waits.

On this page

Examples

End before start

Installation

npx knowns-ui@latest add time-range-card
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

value / defaultValue
{ start, end }
Default9:00 to 10:00
Minutes after midnight.
onValueChange
(range) => void
Any change, valid or not.
title / description
ReactNode
Default"Time range"
The heading and the line under it.
step
number
Default30
Minutes between the times in the selects.
min / max
number
Default0 / 1440
The earliest and latest times offered.
durations
number[]
Default[30, 60, 90, 120, 180]
Chips that set the end from the start. [] hides them.
hourCycle
"12" | "24"
Default"12"
The clock.
onApply
(range) => void
Shows Apply. It waits while the range is invalid.
onCancel
() => void
Shows Cancel.
applyLabel
string
Default"Apply"
The Apply button's text.

When to use

When to use

  • Blocking time on a known day: focus time, office hours, a maintenance window.
  • A filter or setting that needs a start and an end time.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Time Range Card to my app and wire it to my own data.
  • I need blocking time on a known day: focus time, office hours, a maintenance window. Set that up with the Knowns UI Time Range Card.
  • Which Time Range Card props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "time-range-card" }) and search_docs({ query: "time range card" }).

Need help?

Stuck on Time Range Card, or found something off? We read every message.