Theme
Design your own
On this page (6)

§The three questions

1. What does the user do? Read, choose or edit, move around, or get told something. Reading needs no controls; every control you add is something to learn. 2. What shape is the data? One value, records, a hierarchy, links between things, values over time, keys with values, places. The shape picks the family. 3. How much? Up to a few hundred elements, render all of it: the browser's find, print and accessibility tools work on the whole. Beyond that, take a windowed component - it draws the rows in view and runs every query over all of them (a million rows).

§Data you show

When you needUseWhySkills · folders
One number or a status - a KPI, a total, a healthStatistic · Badge · Indicator · Progress · Radial Progress · Tachoone glance; a meter or a needle when the range mattersstatistic badge indicator progress radial-progress tacho · data-display/ feedback-status/ multimedia/
A few records that fit the page (up to a few hundred)Table · Card · Timelineall in the DOM: find in page, print, no scripttable card timeline · data-display/
Thousands to a million records - sorted, filtered, selectedData Grid · Virtual List · Big Datawindowed: only the rows in view are drawn, every query runs over all rowsdata-grid virtual-list chart · big-data/ charts/
A directory tree or a small hierarchyTree View · Collapsiblenative details, keys of the tree patterntree-view collapsible · data-display/
A big hierarchy, or a hierarchy with columnsData Tree · Tree Gridwindowed; branches open on demanddata-tree data-grid · big-data/
Linked data to explain - an architecture, a flow, a few dozen nodesIllustrative Diagrams · Mermaiddrawn to make one point, step by step if neededdiagram mermaid · diagrams/
Linked data to explore - thousands to millions of nodesGraph Explorersemantic zoom, a worker lays out what is neargraph-explorer · graphs/
A time series - values over timeChange over time · Chartlines and areas; one chart morphs between viewschart · charts/
Events in time - a history, a schedule, a recordingTimeline · Calendar · Media Timelinea list of moments, a month, a ruler under a playertimeline calendar media-timeline · data-display/ multimedia/
Values not over time - a comparison, a share, a distributionComparison · Composition · Distributionthe chart form follows the question askedchart · charts/
Associative data - an object, metadata, settings (key and value)Property Grid · Tableone row per key; the Property Grid edits in placeproperty-grid table · application/ data-display/
Evaluation results - scores per case, pass and fail, a run against a runData Grid · Badge · Comparison · Difffilter the failures, rank the scores, compare two runsdata-grid badge chart diff · big-data/ data-display/ charts/
Two versions of one thingDiffbefore and after, side by side or inlinediff · data-display/
Places, regions and routesGeo Mapequal-area projections, regions to select, routes on a graphgeo-map · geography/
Formulas and their resultsFormula Rendering · Compute & Explaintypeset TeX; a computation with its conditionsmath-renderer math-compute · math/
Code and terminal outputCode · HTML Preview Editora window to read; a live preview to runmockup-code code-example · mockup/ wysiwyg-editors/
Long text - an article, a report, a paperTypography · Modern Paper · Table of Contentsa reading measure, a contents list that followstypography paper toc · primitives/ papers/ navigation/

§Input you take

When you needUseWhySkills · folders
On or offSwitch · Checkbox · Togglea setting that applies now; a choice in a form; a pressed toolswitch checkbox toggle · forms-inputs/ actions/
One of two to four, cycled with one clickSwap · Language Switcherthe next value is one click awayswap language-switcher · actions/ navigation/
One of three to seven, all in viewRadio Group · Toggle Groupevery option visible, no list to openradio toggle-group · forms-inputs/ actions/
One of manySelect · Comboboxnative up to a dozen or so; with more, a search fieldselect combobox · forms-inputs/
One of thousands, or from a serverAutocomplete · Commanddebounced requests, the last one winsautocomplete command · big-data/ overlays/
Several of manyCheckbox · Comboboxa short list as boxes; a long one as tagscheckbox combobox · forms-inputs/
A number or an amountNumber Input · Slider · Knobs · Ratingtyped, dragged, turned or tappednumber-input slider knob rating · forms-inputs/ multimedia/
A date, a color, a file, a codeDate Picker · Color Picker · File Input · OTP Inputnative controls under a consistent lookdate-picker color-picker file-input otp-input · forms-inputs/
A short or a long textInput · Textareavalidation by the browser, the textarea grows with its textinput textarea · forms-inputs/
A record - several fields, maybe several stepsForm · Questionnairenative validation; branches and drafts when the answers decide the wayform questionnaire · forms-inputs/ questionnaire/
Many records in placeData Gridthe cell edits, the query keeps its filtersdata-grid · big-data/
Rich text and comments on itEditor.js · Document Commentsblocks with Markdown in and out; comments anchored in the texteditorjs doc-comments · wysiwyg-editors/ application/
A formulaFormula Editinga math field over a textarea that stays the form controlmath-editor · math/
A page, visuallyVisual Editor · HTML Preview Editordrag blocks; or edit the source next to its previewvisual-editor code-example · wysiwyg-editors/

§Moving around

When you needUseWhySkills · folders
The main sections of a site or an appNavbar · Navigation Menu · Sidebar · Dockalways in view; a sidebar when there are manynavbar navigation-menu sidebar dock · navigation/ application/
Where am I - and the way up or through the pageBreadcrumb · Table of Contentsthe path; the sections of a long pagebreadcrumb toc · navigation/
Peer views of one thingTabs · Accordionone view at a time; several open at oncetabs accordion · navigation/ overlays/
A long result in partsPagination · Virtual Listpages to address; one scroll for everythingpagination virtual-list · navigation/ big-data/
A sequence of stepsSteps · Questionnairewhere the user is and what is leftsteps questionnaire · navigation/ questionnaire/
Commands - from anywhere, on a thing, in a menu barCommand · Context Menu · Dropdown Menu · Menubarsearch every action; the actions of one item; an app menucommand context-menu dropdown menubar · overlays/ navigation/
The language and the themeLanguage Switcher · Theme Switcherthe page language through defuss-i18n; a theme as one stylesheetlanguage-switcher theme-switcher · navigation/
A workspace the user arrangesBorder Layout · Panel · Resizer · Windowregions that fold, panels that stack, windows that moveborder-layout panel resizer window · application/

§Telling the user

When you needUseWhySkills · folders
Something happened - no answer neededToastit goes by itself; the page stays usabletoast · feedback-status/
A state of one part of the pageAlert · Badgein place, as long as the state lastsalert badge · feedback-status/ data-display/
An answer is required before going onAlert Dialogmodal - the one case that blocks the pagealert-dialog · feedback-status/
A focused task over the pageDialog · Sheeta form or a detail without leaving the pagedialog sheet · overlays/
More detail on demandPopover · Tooltip · Collapsiblea hint on hover, a panel on click, a section that openspopover tooltip collapsible · overlays/ data-display/
WaitingSpinner · Skeleton · Progressunknown time; the shape of what comes; a known sharespinner skeleton progress · feedback-status/

§Rules of thumb

The platform first. A native control - select, details, dialog, a checkbox - brings its keys, its form value and its accessibility with it. Take the scripted component when the native one cannot do the job: a search over many options, a windowed list, a tree with columns. See Native Web APIs.

Show before you hide. Two to seven options fit on screen: radios, a toggle group, tabs. A list that opens costs a click and hides the choice; a modal costs the whole page. Open a dialog only for a focused task, and an alert dialog only when the answer is required.

Search from eight. This system offers a search field once a list holds more than seven options: the Combobox, the Language Switcher from eight languages, the Command palette for a whole app.

Explain small, explore big. An Illustrative Diagram makes one point with a few dozen boxes and can reveal it step by step. When the reader has to find their own way through thousands of nodes, the Graph Explorer zooms by meaning and loads what is near.

Interactive only where it pays. A chart that makes one point stays still and says it in its title (Narrative); a chart for exploring gets tooltips, zoom and a grid that filters it. Every interaction is something to discover, to learn and to keep working.

One look, one language. Variants and sizes are data attributes on the same classes, and every component reads the same tokens, so a page built from several of them looks like one thing - see Data Attribute API and Theming. An agent finds each component's markup in its skill; the whole system is one skill, skills/defuss-shadcn/SKILL.md (Component Skills).

Comments, ideas or improvements? Edit this page's source on GitHub