@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

Button

atoms

The one control for actions: four variants, five tones, four sizes, a corner count and a stacked hotbar layout, all on a native button or link.

See also IconButtonCopyButtonSplitButtonToggle

Dialog footer

variant="primary" carries the one main action; ghost and default stand beside it.

Changes apply to all 12 members of the workspace.

Variants, tones and sizes

variant picks the chrome, tone the colour, size the height; pill rounds it, control matches input height.

States

disabled, loading, pressed, a corner count (hidden at 0, capped by countMax) and a block button that fills its row.

Hotbar slots and links

layout="stacked" puts glyph over the label with a shortcut hint; href renders a real link with the same chrome.

Open repository Back to top of section Inactive link

Variant × tone matrix

Regression fixture: every variant against every tone; primary keeps a readable on-accent label.

Hover effects

data-fx-hover on any ancestor picks the ambient hover (smoke is the default, none turns it off); the nearest one wins. Every press scales in fast and releases on a spring; ember sinks 1px instead. Fine pointers only.

data-fx-hover="smoke"
data-fx-hover="ember"
data-fx-hover="aurora"
data-fx-hover="none"

Loading styles

loadingStyle: spinner (default) prepends a spinner; morph dissolves the label into a centred spinner and springs doneLabel back in at constant width; fill pours progress in from the left and recolours the label as it passes.

Fast vs slow save

loading shows nothing for the first 200 ms and then stays at least 500 ms, so a 60 ms save never flashes a spinner while a 1.5 s one reads as steady work. aria-busy and the click block follow loading at once. loadingDelay / loadingMin tune or disable it (0).

0 saved

Props

PropTypeDefaultDescription
variant 'default' | 'primary' | 'ghost' | 'danger' | 'link''default'`link`: no box at all — an inline text action coloured like a link (or like `tone` when set), underlined on hover/focus.
tone Tone | 'none''none'Semantic state tint layered on top of the variant: tints text/border and adds a subtle fill on hover. For stateful controls — an "on"/active toggle (`accent`), positive actions (`success`), or cost/severity states.
size ControlSize | 'xl'—
control boolean—
pill booleanfalseFully rounded ends (`--r-pill`) on any size/variant.
block booleanfalse
grow booleanfalseFill the available width of a flex/Cluster row (flex: 1). `block` stretches to 100% (grid/stack); `grow` shares a flex row with siblings.
shrink booleantrue`shrink={false}` pins the button to its intrinsic width in a flex row (flex: none, top-aligned) so a growing sibling can't squash it.
as 'button' | 'a''button'Render as a link (`<a href>`) while keeping button chrome — for navigations and open-in-new-tab actions that shouldn't be a bare <a>. Setting `href` implies `as="a"`.
href string—
icon booleanfalseSquare icon-only tap target (IconButton), `--box-md` unless `box` says otherwise. `iconInline` is the borderless, compact variant (chip-remove ✕, inline edit ✎); pair with `hoverDanger` to tint it red on hover (delete affordances).
box 'xs' | 'sm' | 'md' | 'lg'—Shared square box scale (`--box-xs/sm/md/lg`): always square, no padding, never flexes. Implies an icon-only control.
square booleanfalseSquare text/icon control whose side equals the current height contract: `size` tier, or the control height with `control`.
chip booleanfalseOutlined `--box-lg`-tall chip (header/toolbar action): a square for a lone glyph, otherwise sized to its text. Pairs with `tone` for tinted severity chips.
iconInline booleanfalse
hoverDanger booleanfalse
collapseLabel 'never' | 'mobile' | 'container'—Hide `[data-label]` children below 40rem viewport (`mobile`) or 30rem container (`container`) so the button becomes icon-only; the hidden text becomes the aria-label unless one is set.
hitArea 'auto' | 'compact''auto'Icon-only/square buttons grow a touch hit slab on coarse pointers without moving layout; `compact` opts out in dense tables.
loading boolean | 'done'falseAsync/busy state: shows a spinner, blocks clicks, sets aria-busy and aria-disabled. Stays focusable (no native disabled) so focus survives the toggle, while clicks stay blocked (so a double-submit can't fire). `'done'` is the settled state after a busy run: clickable again, a check beside the label (with `loadingStyle="morph"` the label springs back in).
loadingStyle 'spinner' | 'morph' | 'fill''spinner'How a busy button shows it: an inline spinner before the label, the label morphing into a centred spinner at constant width, or a progress fill pouring in from the left (driven by `progress`).
loadingDelay number—Calm loading: the visual waits `loadingDelay` ms and then stays at least `loadingMin` ms; aria-busy and the click block follow `loading` at once. 0 for both shows and hides with `loading`.
loadingMin number—
progress number—0–1 for `loadingStyle="fill"`; omit for an indeterminate idle fill.
doneLabel string—Text beside the check in the `'done'` state; defaults to the children. With `morph`, keep the children constant and set this instead so both stacked labels size the button and its width never changes.
count number—Corner count indicator (unread, selected, pending). Hidden at 0/undefined; shows `${countMax}+` past the cap while the accessible name carries the exact number.
countMax number99
layout 'inline' | 'stacked''inline'`stacked`: a hotbar slot, `glyph` over the label, height following `size`.
glyph Snippet | string—Leading glyph (above the label when stacked): a registry icon name, any other text (emoji, ■), or a snippet.
shortcut string—Key hint in the top-left corner, also exposed as `aria-keyshortcuts`. Display only: the app binds the key.
pressed boolean—Two-state toggle: sets `aria-pressed`.
sound booleantruePlay UI sounds when enabled globally; false silences this instance.
class string''
children Snippet—
target string—
rel string—
MIT · @dorsk/tsumikit