# Components

Every component, grouped as in the playground. Each page has a rendered example, its source, how to write it, and its props. These pages are generated from the catalog by `npm run docs`.

Any element inside a screen can also take `tooltip="…"`; see [Tooltips and open states](https://tsquare.dev/docs/language.md#tooltips-and-open-states).

## Canvas

| Component | What it's for |
|---|---|
| [board](https://tsquare.dev/docs/components/board.md) | Root canvas (artboard). Holds Screens side by side, plus optional Notes and Flow lines. Must be the root element. |
| [screen](https://tsquare.dev/docs/components/screen.md) | One view of the product in a device frame. Children stack vertically. |
| [note](https://tsquare.dev/docs/components/note.md) | Sticky-note annotation. Put it on the Board beside screens, or inside a Screen next to what it explains. |
| [flow](https://tsquare.dev/docs/components/flow.md) | An arrow between two elements or screens, named with #id. Write each flow on its own line after the screens, indented like a screen (not inside one): flow signin -> home "Tap Sign in". |

## Layout

| Component | What it's for |
|---|---|
| [stack](https://tsquare.dev/docs/components/stack.md) | Flex container. The main layout primitive (rows, columns, sidebars, toolbars). |
| [grid](https://tsquare.dev/docs/components/grid.md) | Equal-width columns that wrap. Good for card grids and galleries. |
| [card](https://tsquare.dev/docs/components/card.md) | Bordered container with optional title. Children stack vertically. |
| [accordion](https://tsquare.dev/docs/components/accordion.md) | Collapsible section: a title row with a chevron, children below when open. Stack several for an FAQ. |
| [divider](https://tsquare.dev/docs/components/divider.md) | Thin separator line. |
| [spacer](https://tsquare.dev/docs/components/spacer.md) | Empty space. Without a size it grows to push siblings apart. |

## Content

| Component | What it's for |
|---|---|
| [heading](https://tsquare.dev/docs/components/heading.md) | Heading text, level 1 (largest) to 3. |
| [text](https://tsquare.dev/docs/components/text.md) | Body text, or placeholder lines when `lines` is set and `text` is not. |
| [bullets](https://tsquare.dev/docs/components/bullets.md) | Bulleted, numbered or icon list of short lines. |
| [image](https://tsquare.dev/docs/components/image.md) | Image placeholder: a box with an X through it, or a map. |
| [chart](https://tsquare.dev/docs/components/chart.md) | Chart placeholder: a generic line, bar, area, pie or donut shape, no data. |
| [icon](https://tsquare.dev/docs/components/icon.md) | Line icon from Lucide, or a brand logo (brand-google, brand-apple, …). |
| [avatar](https://tsquare.dev/docs/components/avatar.md) | Round avatar with initials or a person silhouette. |
| [badge](https://tsquare.dev/docs/components/badge.md) | Small pill label for counts or statuses. |

## Controls

| Component | What it's for |
|---|---|
| [button](https://tsquare.dev/docs/components/button.md) | Button. Primary is filled, secondary is outlined, ghost is text only. With menu and open, a dropdown menu. |
| [input](https://tsquare.dev/docs/components/input.md) | Text field with optional label. Set multiline for a textarea. |
| [checkbox](https://tsquare.dev/docs/components/checkbox.md) | Checkbox with label. |
| [radio](https://tsquare.dev/docs/components/radio.md) | Radio button with label. |
| [toggle](https://tsquare.dev/docs/components/toggle.md) | On/off switch with label on the left. |
| [select](https://tsquare.dev/docs/components/select.md) | Dropdown field. With options and open, the list shows below it. |
| [slider](https://tsquare.dev/docs/components/slider.md) | Slider with one handle, or two with `range`. |
| [progress](https://tsquare.dev/docs/components/progress.md) | Progress bar, ring (circle), or stepper (steps). |
| [calendar](https://tsquare.dev/docs/components/calendar.md) | Month calendar. |

## Navigation & data

| Component | What it's for |
|---|---|
| [navbar](https://tsquare.dev/docs/components/navbar.md) | Top app bar. Place first in a Screen. |
| [tabbar](https://tsquare.dev/docs/components/tabbar.md) | Bottom tab bar for mobile. Place last in a Screen (before overlays). |
| [tabs](https://tsquare.dev/docs/components/tabs.md) | In-page tabs with an underline on the active one. |
| [pagination](https://tsquare.dev/docs/components/pagination.md) | Page numbers with previous and next. |
| [list](https://tsquare.dev/docs/components/list.md) | Vertical list of ListItems. |
| [listitem](https://tsquare.dev/docs/components/listitem.md) | Row in a List. Omit title for a placeholder bar. |
| [table](https://tsquare.dev/docs/components/table.md) | Table with headers. Rows are placeholder bars unless `data` is given. |

## Overlays

| Component | What it's for |
|---|---|
| [modal](https://tsquare.dev/docs/components/modal.md) | Centered dialog over the screen. Must be a direct child of a Screen, listed last. |
| [drawer](https://tsquare.dev/docs/components/drawer.md) | Panel sliding in from an edge: side nav (left), filters/details (right), or bottom sheet. Must be a direct child of a Screen, listed last. |
| [toast](https://tsquare.dev/docs/components/toast.md) | Short message over the screen, e.g. after saving. Must be a direct child of a Screen, listed last. |
