@dorsk/tsumikit

Svelte 5 · pure CSS · zero deps
AppShell Principles
v0.101.0
Foundations
Typography 5 ThemeTokens 5 Theming 3 TextScaling 3 Breakpoints 1
Atoms
Artwork 3 Avatar 3 Badge 4 Button 8 Card 6 Checkbox 4 Divider 3 Dot 3 Gauge 4 Heading 3 Icon 4 Input 4 Kbd 3 Link 5 Progress 5 Scrim 3 SegmentedProgress 3 Select 3 Skeleton 5 Slider 3 Spinner 4 Swatch 3 Switch 4 Text 5 Textarea 5 Thinking 2 TimeDisplay 3
Molecules
Accordion 3 AttachmentList 3 Breadcrumb 3 ButtonGroup 3 Callout 3 CapBar 3 Carousel 3 ChatBubble 4 CodeBlock 4 Combobox 3 Composer 3 ConfirmModal 3 CopyButton 4 Disclosure 4 Drawer 3 Dropzone 3 EmojiPicker 3 EmptyState 4 Field 4 Fieldset 4 FileButton 3 FilterChips 6 FilterInput 4 FontScalePicker 3 GitRef 3 GlyphStack 3 IconButton 4 InputGroup 3 KeyValue 3 LoadMore 3 LookPicker 3 Menu 4 Meter 4 Metric / StatTile 4 Modal 3 MotionSettings 3 NotificationItem 2 OptionButton 3 Pagination 4 Popover 3 Prose 6 PullToRefresh 3 RadialMenu 3 RadioGroup 4 RichSelect 3 SectionHeader 3 SeekSlider 4 SegmentedControl 7 SelectButton 3 SortableList 4 SoundSettings 3 SplitButton 3 StatusBar 3 SwipeRow 3 Tabs 6 ThemePicker 3 Timestamp 3 Toaster 6 Toggle 3 Tooltip 3 Truncate 3 VolumeSlider 3 WorkingDir 3
Organisms
ConversationFeed 3 ConversationPanel 3 DataTable 9 FilterSearchBar 4 NotificationCenter 5
Layouts
AppShell 3 Backdrop 3 Container 3 Stack 4 Cluster 4 AutoGrid 3 MasterDetail 4 ResizablePanel 4 NavSection 3 NavItem 4 NavBar 4 TabBar 4 Toolbar 5

CapBar

molecules

A usage bar with a draggable cap: value is what is used, cap is the limit you drag or arrow-key, with warn tones, an expected marker, uncapped mode, stacked layout and readonly.

See also MeterSliderProgressMetric

Provider caps

one row per provider: value, bind:cap, hint, an expected marker and onchange when the drag or arrow keys settle.

Anthropic
expected by now
cap 80%
62% · resets 3h
OpenAI
expected by now
cap 90%
81% · resets 12h
Gemini
no cap
44% · resets 1d
Mistral
cap 80%
95% · resets 6h

Size, layout and stacking

size="lg", layout="stacked" puts the label above the bar, stackBelow stacks only under that container width, labelWidth and readoutWidth align columns.

Large
cap 90%
81% · resets 12h
Stacked
cap 70%
44% · label above the bar
Auto-stack
cap 60%
58% · stacks under 30rem
Wide label column
cap 50%
30%

States

readonly over its cap, uncapped (cap={null}, clearAtMax, uncappedLabel), the caption snippet, custom step and min/max, and the 0% / 100% edges.

Locked
cap 80%
95% · over cap
Gemini
no cap
44% · uncapped
Anthropic
cap 80%
62% · resets 3h
▲ using 62% · cap 80%
Tokens
cap 600%
420%
Cap at 0%
cap 0%
0%
Cap at 100%
cap 100%
100%

Props

PropTypeDefaultDescription
value number0Consumption, in percent of `max`.
cap bindable number | null100Cap position; bindable, moved by drag/keyboard. `null` is uncapped.
min number0
max number100
step number5Snap increment for drag and keyboard.
warnAt number75Consumption at which the fill turns `--warn`.
size 'md' | 'lg''md'
layout 'row' | 'stacked''row'`'stacked'` puts label + readout on a line above a full-width track.
stackBelow string—Own-width threshold (px/em/rem) below which `layout` becomes `'stacked'`.
marker number | null—Reference position on the track, in the same units as `value`.
markerLabel string—
markerTone 'neutral' | 'ok' | 'warn' | 'danger''neutral'
uncappedLabel string'no cap'Spoken and readout text for `cap === null`.
clearAtMax booleanfalseMoving the cap to `max` yields `null` instead of `max`.
capLabel string—Accessible name of the cap handle. Defaults to `${label} cap`.
capValueText string | ((cap: number | null) => string)—Spoken value of the cap handle. Defaults to `cap ${cap}%`.
label string | Snippet—
labelWidth string'96px'
readout string | Snippet—Overrides the default `{value}% · {hint}` readout.
readoutWidth string'auto'
hint string—
caption Snippet—
tooltip string—Track tooltip; defaults to "cap N% — drag the bar".
readonly booleanfalse
oninput (cap: number | null) => void—Fires live while dragging or stepping.
onchange (cap: number | null) => void—Fires once the cap is committed (pointer release / key-up).
class string''
style string''
MIT · @dorsk/tsumikit