sveltelean Primitives
Version v0.18.0

At a glance

A selection, live. Each name opens its page.

What a primitive is

  • Markup with a contract, not a component: no import per instance, no wrapper. The root carries data-slean="<name>" for the stylesheet and development diagnostics.
  • Tier 0 stops there. Tier 1 adds one registration per page, which @svelte-lean/vite injects for every static marker; one shared router handles every root. Tier 2 also keeps a small controller for a root once it is used.
  • Attribute primitives (Hint, Copy, Findable) have no root of their own: any element with their attribute is one.
  • Primitives with many ids to wire export an attribute helper, such as selectParts(id), that writes every part id and ARIA reference from the root id; plain markup works the same. Each page shows both side by side: Select, Autocomplete, Date picker, Tabs, Field.
  • Each contract (contract.md in packages/primitives/src) fixes semantics, parts, keyboard, focus, server output, behavior without JavaScript and the tests. More on Runtime tiers and DOM protocol.

The primitives

NameTierNative baseBehavior JSShared listenersPlatform features
Actions
Button0 · Native<button type="button">0 B brotlinone<button>, :focus-visible, :disabled, aria-busy
Button group0 · Nativebuttons in role="group"0 B brotlinonerole="group", logical radii, color-mix(), :focus-visible
Toggle1 · Delegated<button type="button" aria-pressed>not measuredclick<button>, aria-pressed
Toggle group1 · Delegated<button aria-pressed> items in role="group"1932 B brotliclick, keydown<button>, aria-pressed, role="group", :dir(rtl)
Toolbar1 · Delegatedrole="toolbar"1706 B brotlikeydown, focusinrole="toolbar", aria-orientation, focusin, :dir(rtl)
Copy1 · Delegatednavigator.clipboard.writeText + <button>1291 B brotliclicknavigator.clipboard.writeText(), <button>, data-slean-copied
Forms
Input1 · Delegated<input> of any type, <textarea>; stepUp()/stepDown(), type="password"↔"text"1808 B brotliclick, pointerdown, pointerover, focusin<input> of every type, <textarea>, stepUp() / stepDown(), :user-invalid, :placeholder-shown, ::file-selector-button, field-sizing: content
Field0 · Native<label for>, a control, aria-describedby; constraint validation0 B brotlinone<label for>, aria-describedby, aria-invalid, :has()
Select2 · Lazy<select> + role=combobox trigger + [popover] + ARIA listbox (role=listbox, option)5020 B brotliclick, keydown, input, pointerdown, pointerover, focusout, change, toggle, reset, animationstart<select>, appearance: base-select, role="combobox", aria-activedescendant, popover="manual", anchor-name, @media (scripting)
Checkbox0 · Native<input type="checkbox">, role="switch"0 B brotlinone<input type="checkbox">, role="switch", :checked, :indeterminate, :user-invalid
Checkbox group1 · Delegated<fieldset> + <input type="checkbox">, indeterminate1456 B brotlichange, focusin, reset<fieldset>, <input type="checkbox">, indeterminate, :indeterminate
Radio group0 · Native<fieldset> + <input type="radio" name="…">0 B brotlinone<fieldset>, <legend>, <input type="radio">, name
Rating0 · Native<fieldset> of <input type="radio"> sharing a name0 B brotlinone<input type="radio">, <fieldset>, <legend>, :has(), inline SVG
Slider1 · Delegated<input type="range">, one or two in a group1549 B brotliinput, reset<input type="range">, ::-webkit-slider-thumb, ::-moz-range-progress, accent-color, writing-mode, two <input type="range"> in a group
File drop1 · Delegated<input type="file"> stretched over a drop area; DataTransfer for the file list2983 B brotlidragenter, dragleave, drop, paste, input, change, click, reset<input type="file">, drop, paste, DataTransfer, URL.createObjectURL, Intl.ListFormat, @media (scripting)
Autocomplete2 · Lazy<input list> + <datalist>; owned: role=combobox input + [popover] + ARIA listbox3960 B brotliclick, keydown, input, pointerdown, pointerover, focusin, focusout, toggle<input list>, <datalist>, role="combobox", aria-activedescendant, popover="manual", KeyboardEvent.isComposing, anchor-name
Listbox1 · DelegatedARIA listbox markup (role=listbox, option)2357 B brotliclick, keydown, change, resetrole="listbox", role="option", aria-selected, roving tabindex, :dir(rtl)
Date and time
Calendar1 · Delegatedrole=grid of day buttons in a <table>4594 B brotliclick, keydown, change, reset, pointerover, pointeroutrole="grid", aria-selected, aria-current="date", Intl.DateTimeFormat, Intl.RelativeTimeFormat, :dir(rtl)
Date picker2 · Lazy<input type="date"> + role=combobox text input + [popover] + calendar9476 B brotliclick, keydown, input, change, pointerdown, pointerover, focusin, focusout, toggle, reset<input type="date">, <input type="datetime-local">, <input type="time">, role="combobox", popover="manual", anchor-name, @media (scripting), Intl.DateTimeFormat, Intl.RelativeTimeFormat, Intl.DisplayNames
Overlays
Dialog0 · Native<dialog> + command/commandfor0 B brotlinone<dialog>, showModal(), command, commandfor, closedby, top layer, ::backdrop, position: sticky
Popover0 · Native[popover] + popovertarget or command/commandfor0 B brotlinonepopover, popovertarget, :popover-open, position-area
Tooltip1 · Delegatedrole="tooltip" + popover="manual" + aria-describedby2687 B brotlipointerover, pointerout, pointerdown, focusin, focusout, keydownpopover="manual", role="tooltip", aria-describedby, :focus-visible, Range.getBoundingClientRect()
Hover card1 · Delegatedpopover="hint" named by interestfor1985 B brotlipointerover, pointerout, focusin, focusout, keydowninterestfor, popover="hint", showPopover({ source }), position-area
Menu1 · Delegated[popover] + ARIA menu (role=menu, menuitem)2771 B brotliclick, keydown, beforetoggle, togglepopover, beforetoggle, role="menu", role="menuitem", aria-checked, contextmenu event
Menubar1 · Delegatedrole="menubar" of popovertarget menu buttons2063 B brotlikeydown, focusin, pointeroverrole="menubar", popovertarget, showPopover(), :popover-open, :has()
Toast2 · Lazypopover="manual" region + aria-live list1616 B brotliclick, pointerover, pointerout, focusin, focusoutpopover="manual", aria-live="polite", showPopover(), :popover-open
Navigation
Tabs1 · DelegatedARIA tabs markup (role=tablist, tab, tabpanel)1839 B brotliclick, keydownrole="tablist", role="tab", aria-selected, roving tabindex, hidden
Nav0 · Native<nav> + <ul> of links + <details name> groups + aria-current="page"0 B brotlinone<nav>, <details name>, aria-current="page", :has(), ::details-content, scroll-target-group
Breadcrumb0 · Native<nav> + <ol> + aria-current="page"0 B brotlinone<nav>, <ol>, aria-current="page", :dir(rtl)
Pagination0 · Native<nav> + links + aria-current="page"0 B brotlinone<nav>, <a href>, aria-current="page", :dir(rtl)
Steps0 · Native<ol> + aria-current="step"0 B brotlinone<ol>, aria-current="step", :has(), CSS counters
Tree1 · Delegatedrole="tree", treeitem, group, aria-expanded2140 B brotliclick, keydownrole="tree", treeitem, group, aria-expanded, aria-selected, :dir(rtl)
Layout and display
Accordion0 · Native<details> + <summary>, exclusive groups through name0 B brotlinone<details name>, <summary>, toggle, ::details-content, interpolate-size
Card0 · Native<article>0 B brotlinone<article>, ::after, :has()
Splitter2 · Lazyrole="separator" (WAI-ARIA window splitter) + CSS grid1908 B brotlikeydown, pointerdownrole="separator", aria-valuenow, setPointerCapture(), touch-action, CSS grid
Sortable2 · Lazy<ul>/<ol> + <button> handles; document order is the value3833 B brotlipointerdown, keydown, click<ul>/<ol>, <button>, setPointerCapture(), touch-action, moveBefore(), role="status"
Scroll area0 · Nativeoverflow: auto + tabindex="0" in role="region"0 B brotlinoneoverflow: auto, tabindex="0", scrollbar-width, scrollbar-color, scrollbar-gutter, overscroll-behavior, animation-timeline: scroll()
Separator0 · Native<hr>, role="separator"0 B brotlinone<hr>, role="separator", aria-orientation
Avatar0 · Native<img> with initials behind it0 B brotlinone<img>, alt, role="img", CSS grid
Badge0 · Native<span> with an optional remove <button>0 B brotlinone<span>, text, <button>, aria-label, :has()
Keyboard key0 · Native<kbd>0 B brotlinone<kbd>, nested <kbd>, :has()
Carousel0 · Nativescroll-snap, ::scroll-button(), ::scroll-marker0 B brotlinonescroll-snap, ::scroll-button(), ::scroll-marker, ::scroll-marker-group, scroll-state queries
Descriptions0 · Native<dl> with <div> groups of <dt> and <dd>0 B brotlinone<dl>, <dt>, <dd>, CSS grid, min(), max()
Timeline0 · Native<ol> of <li> events with <time datetime>0 B brotlinone<ol>, <time datetime>, :has()
Findable1 · Delegatedhidden="until-found" + beforematch1887 B brotlibeforematchhidden="until-found", beforematch, content: attr(), translate
Feedback
Alert0 · Native<div> + live region roles (status, alert)0 B brotlinonerole="status", role="alert", :empty, color-mix()
Progress0 · Native<progress value max>0 B brotlinone<progress>, :indeterminate, appearance: none, ::-webkit-progress-value, conic-gradient(), mask
Meter0 · Native<meter min max low high optimum value>0 B brotlinone<meter>, low, high, optimum, ::-webkit-meter-optimum-value
Skeleton0 · Nativearia-hidden placeholders in an aria-busy region0 B brotlinonearia-hidden, aria-busy, prefers-reduced-motion, :dir(rtl)
Empty state0 · Nativea heading, a paragraph and an optional action0 B brotlinoneheadings, links and buttons, :empty

Behavior JS: the production registration module with the shared kernel (packages/primitives/artifacts/size.json); for Tier 0, the Svelte Lean chunk of the native-only fixture (fixtures/results.json). The proof page mounts one of each and reads the document's listeners.

Compositions

Built from the primitives above and documented as examples, not shipped as primitives.

ComponentComposition
Date range pickera date picker in range mode
Time pickeran input of type time
Command palettea dialog holding an autocomplete
Tags inputa multiple select with search and create
Drawer, alert dialoga dialog with a side or the alertdialog role
Switch, segmented controla checkbox with role="switch", a segmented radio group
Spinner, chipa circular progress, a removable badge
Multi-select dropdowna multiple listbox in a popover
Popconfirm, navigation menupopovers
Image previewa dialog

Not planned as primitives: cascader, tree select and transfer (applications of tree, listbox and popover); tours, watermarks, QR codes, charts, rich text and mentions (application features). Catalog and tier decisions: docs/catalog.md.