Two to five mutually exclusive views in a trough with a sliding thumb — Month · Week · Timeline · Agenda, Both · Payable · Receivable. The labels stay put and the thumb moves. Arrow keys move the choice and wrap.
import { SegmentedControl } from "@puckoops/camelot";| Name | Description | Default | Control |
|---|---|---|---|
| options* | SegmentOption<T>[] | - | |
| aria-label* | string | - | |
| value | T | - | - |
| defaultValue | T | - | |
| onValueChange | (value: T) => void | - | - |
| size | 30px or the 36px control height "sm""md" | "md" | |
| className | string | - |
Use SegmentedControl to switch views or a direction filter (Both · Payable · Receivable) without leaving the page.
30px, for a topbar or a card header.
A direction filter over the same list of obligations.
Controlled by state, as when the view lives in the URL.
Showing the timeline view
Both sizes and a three-way appearance switch.