# Components

> All 44 components and charts, grouped by the job they do. Install any of them with `npx dtheo@latest add <name>`.

## Actions

- [Button](https://ui.dtheo.dev/docs/components/button.md) `button`: Triggers an action. One primary button per view marks the action that matters most.
- [Toggle and segmented control](https://ui.dtheo.dev/docs/components/toggle.md) `toggle`: A pressed/unpressed button, and a segmented control for a few mutually exclusive modes.

## Inputs

- [Input](https://ui.dtheo.dev/docs/components/input.md) `input`: A single-line text field. Aligns with buttons and selects of the same size.
- [Field](https://ui.dtheo.dev/docs/components/field.md) `field`: Groups a label, a control, help text and an error, and wires their ids for assistive tech.
- [Input group](https://ui.dtheo.dev/docs/components/input-group.md) `input-group`: A text field with an icon, unit, keyboard hint or small button inside its border.
- [Textarea](https://ui.dtheo.dev/docs/components/textarea.md) `textarea`: Multi-line text that grows with its content, then scrolls.
- [Number field](https://ui.dtheo.dev/docs/components/number-field.md) `number-field`: A number with steppers, a unit and a scrubbable label. Formats with the user’s locale.

## Selection

- [Select](https://ui.dtheo.dev/docs/components/select.md) `select`: Choose one option from a list. The popup aligns the selected item over the trigger, as macOS does.
- [Combobox](https://ui.dtheo.dev/docs/components/combobox.md) `combobox`: A searchable select for long lists, with a clear button and an explicit empty state.
- [Checkbox](https://ui.dtheo.dev/docs/components/checkbox.md) `checkbox`: Turns an independent option on or off, including an indeterminate “some selected” state.
- [Radio group](https://ui.dtheo.dev/docs/components/radio-group.md) `radio-group`: One choice from a short list that stays visible.
- [Switch](https://ui.dtheo.dev/docs/components/switch.md) `switch`: An on/off setting that takes effect immediately.
- [Slider](https://ui.dtheo.dev/docs/components/slider.md) `slider`: A value on a continuous track; pass two values for a range.

## Overlays

- [Dialog](https://ui.dtheo.dev/docs/components/dialog.md) `dialog`: A modal task. Focus moves in, the page behind is inert, Escape closes and focus returns to the trigger.
- [Alert dialog](https://ui.dtheo.dev/docs/components/alert-dialog.md) `alert-dialog`: Confirms a destructive or irreversible action; clicking outside does not dismiss it.
- [Sheet](https://ui.dtheo.dev/docs/components/sheet.md) `sheet`: A panel that slides in from an edge and can be swiped away: inspectors, edit forms, mobile navigation.
- [Popover](https://ui.dtheo.dev/docs/components/popover.md) `popover`: Non-modal content anchored to its trigger: filters, quick settings, details.
- [Tooltip](https://ui.dtheo.dev/docs/components/tooltip.md) `tooltip`: A short label for an icon-only control. After the first, neighbours open instantly.
- [Menu](https://ui.dtheo.dev/docs/components/menu.md) `menu`: Actions or options behind a trigger, with groups, checkable items, submenus and shortcuts.
- [Command palette](https://ui.dtheo.dev/docs/components/command.md) `command`: A ⌘K palette to jump anywhere and run any command. Opens instantly, no animation.
- [Toast](https://ui.dtheo.dev/docs/components/toast.md) `toast`: A brief confirmation that stacks, expands on hover, pauses when hidden and swipes away.

## Navigation

- [Tabs](https://ui.dtheo.dev/docs/components/tabs.md) `tabs`: Switches between views of the same object, as a segmented control or an underline.

## Layout

- [App shell](https://ui.dtheo.dev/docs/components/app-shell.md) `app-shell`: The frame of a product: translucent sidebar, sticky toolbar, page header; the sidebar becomes a sheet on phones.
- [Separator](https://ui.dtheo.dev/docs/components/separator.md) `separator`: A hairline between groups, for when spacing alone does not separate them.
- [Scroll area](https://ui.dtheo.dev/docs/components/scroll-area.md) `scroll-area`: A scroll container with overlay scrollbars and edge fades only where content overflows.

## Feedback

- [Alert](https://ui.dtheo.dev/docs/components/alert.md) `alert`: An inline message about the current view: what happened and what to do next.
- [Empty state](https://ui.dtheo.dev/docs/components/empty.md) `empty`: What to show when there is nothing to show, with the reason and the next step.
- [Progress and meter](https://ui.dtheo.dev/docs/components/progress.md) `progress`: Progress shows task completion; Meter shows a measurement against its range and limit.
- [Spinner and skeleton](https://ui.dtheo.dev/docs/components/spinner.md) `spinner`: An Apple-style activity indicator, and placeholders shaped like the content that is loading.

## Data display

- [Badge](https://ui.dtheo.dev/docs/components/badge.md) `badge`: A short status or category label. Status always carries a word, never color alone.
- [Card](https://ui.dtheo.dev/docs/components/card.md) `card`: A grouped surface with header, content and footer. Depth from a lighter fill and a hairline.
- [Metric](https://ui.dtheo.dev/docs/components/metric.md) `metric`: A measurement with its unit, a meter against its limit and a status that pairs an icon with a word.
- [Table](https://ui.dtheo.dev/docs/components/table.md) `table`: A semantic data table with right-aligned tabular numbers, selection and contained horizontal scroll.
- [Avatar](https://ui.dtheo.dev/docs/components/avatar.md) `avatar`: A person or team, falling back to correct initials (graphemes, suffixes, emoji) when there is no image.
- [Kbd](https://ui.dtheo.dev/docs/components/kbd.md) `kbd`: A keyboard key or shortcut with platform glyphs.
- [Accordion](https://ui.dtheo.dev/docs/components/accordion.md) `accordion`: Sections that expand in place. Good for FAQs and secondary settings.

## Charts

- [Line chart](https://ui.dtheo.dev/docs/charts/line-chart.md) `line-chart`: Engineering traces with limits, bands, markers, a synced crosshair, keyboard reading and downsampling.
- [Bar chart](https://ui.dtheo.dev/docs/charts/bar-chart.md) `bar-chart`: Comparison across a few categories; bars past the limit turn critical so the outlier reads first.
- [Heatmap](https://ui.dtheo.dev/docs/charts/heatmap.md) `heatmap`: A sequential map over two axes, such as motor efficiency over speed and torque.
- [Sparkline](https://ui.dtheo.dev/docs/charts/sparkline.md) `sparkline`: A word-sized trend with an emphasized endpoint.
- [Stream chart](https://ui.dtheo.dev/docs/charts/stream-chart.md) `stream-chart`: A live time series for telemetry: newest sample at the right edge, limits, and anything past a limit in red.
- [Frequency chart](https://ui.dtheo.dev/docs/charts/frequency-chart.md) `frequency-chart`: Frequency response on a log axis: a spectrum, or a Bode plot with gain and phase margins drawn where they are measured.
- [Scatter chart](https://ui.dtheo.dev/docs/charts/scatter-chart.md) `scatter-chart`: The relationship between two measurements across many runs, with limits, a fit line and one point called out.
- [Histogram](https://ui.dtheo.dev/docs/charts/histogram.md) `histogram`: A distribution against specification limits, with n, mean, standard deviation and Cpk stated in words.
