# comp0 > comp0 is a headless React component library: accessible behavior, ARIA wiring, keyboard handling, and data-attribute styling hooks, with no CSS shipped. Import everything from @comp0/react and style it with Tailwind or any CSS. - Import every component from the root: `import { Button } from "@comp0/react";`. - Compose with children. Each family has a root, named parts, and optional `as` to change the rendered element. - State props: `value`/`defaultValue`/`onChange(next)`; `open`/`defaultOpen`/`onOpenChange(next)`; checkable inputs use `checked`. - Style with `className` strings and state attributes such as `data-open`, `data-selected`, `data-focus-visible`, `data-disabled`. - Buttons that dismiss a surface are `*Close`; buttons that clear a value are `*Clear`; charts are `Chart`. ## Learn - [Installation](https://comp0-docs.horrible.workers.dev/learn/installation): Add comp0 once, then take every public component from the same front door. - [Composition](https://comp0-docs.horrible.workers.dev/learn/composition): Put named pieces together so each piece has one easy-to-understand job. - [Styling](https://comp0-docs.horrible.workers.dev/learn/styling): Style every part with Tailwind utility classes and let state attributes drive what changes. - [Forms and state](https://comp0-docs.horrible.workers.dev/learn/forms-and-state): Let native controls send values, and decide who remembers a component’s current state. - [Keyboard and accessibility](https://comp0-docs.horrible.workers.dev/learn/keyboard-and-accessibility): Make every control understandable without a mouse or a pair of eyes. - [Accessible page structure](https://comp0-docs.horrible.workers.dev/learn/accessible-page-structure): Give every page a navigable map, visible focus, comfortable targets, and styles that survive user preferences. - [SSR](https://comp0-docs.horrible.workers.dev/learn/ssr): Make the first server picture and first browser picture match exactly. ## Actions - [Button](https://comp0-docs.horrible.workers.dev/components/button): A familiar native button for one immediate action. - [Toggle Button](https://comp0-docs.horrible.workers.dev/components/toggle-button): A button that stays on or off after a press. - [Link](https://comp0-docs.horrible.workers.dev/components/link): A real anchor for travelling to another URL. - [File Trigger](https://comp0-docs.horrible.workers.dev/components/file-trigger): A visible label that asks the browser for files. - [Visually Hidden](https://comp0-docs.horrible.workers.dev/components/visually-hidden): Extra words that screen readers can hear but sighted people do not see. - [Keybinding Hint](https://comp0-docs.horrible.workers.dev/components/keybinding-hint): A visible, semantic reminder for a keyboard shortcut implemented elsewhere. - [Meter](https://comp0-docs.horrible.workers.dev/components/meter): A fully styleable gauge for a measurement within a known range. - [Progress Bar](https://comp0-docs.horrible.workers.dev/components/progress-bar): A fully styleable progress indicator for how much of a task is done. - [Alert](https://comp0-docs.horrible.workers.dev/components/alert): An assertive live message for important feedback that needs immediate attention. - [Status](https://comp0-docs.horrible.workers.dev/components/status): A polite live message for advisory feedback that should not interrupt the current task. - [Error Summary](https://comp0-docs.horrible.workers.dev/components/error-summary): A focused list of form errors that lets people jump directly to each invalid answer. - [Separator](https://comp0-docs.horrible.workers.dev/components/separator): A native rule that divides content into visually distinct groups. - [Toast](https://comp0-docs.horrible.workers.dev/components/toast): A short status message that appears, announces itself, and leaves on its own. - [Toolbar](https://comp0-docs.horrible.workers.dev/components/toolbar): A labelled strip of controls that share one tab stop. - [Split Button](https://comp0-docs.horrible.workers.dev/components/split-button): A default-action button paired with a menu of alternatives. - [Drop Zone](https://comp0-docs.horrible.workers.dev/components/drop-zone): A surface that accepts files dropped from the desktop. - [Avatar](https://comp0-docs.horrible.workers.dev/components/avatar): An image that keeps a graceful stand-in while it loads or fails. - [Suggestions](https://comp0-docs.horrible.workers.dev/components/suggestions): Quick replies: a labelled group of buttons that each send a value. - [Feedback](https://comp0-docs.horrible.workers.dev/components/feedback): Rate a response with an exclusive pair of Good and Bad toggle buttons. - [CopyButton](https://comp0-docs.horrible.workers.dev/components/copy-button): Copies text to the clipboard and politely announces Copied. ## Charts - [Bar Chart](https://comp0-docs.horrible.workers.dev/components/bar-chart): A categorical comparison with visible axes and the same exact values in a native table. - [Column Chart](https://comp0-docs.horrible.workers.dev/components/column-chart): A vertical categorical comparison with visible axes and the same exact values in a native table. - [Line Chart](https://comp0-docs.horrible.workers.dev/components/line-chart): A trend across ordered numeric or date values, with visible axes and an exact-value table. - [Area Chart](https://comp0-docs.horrible.workers.dev/components/area-chart): A trend whose filled area emphasizes magnitude, with visible axes and an exact-value table. - [Pie Chart](https://comp0-docs.horrible.workers.dev/components/pie-chart): A parts-of-a-whole comparison paired with a persistent legend and exact-value table. - [Candlestick Chart](https://comp0-docs.horrible.workers.dev/components/candlestick-chart): An open-high-low-close financial series with visible axes and every exact value in a native table. - [Scatter Chart](https://comp0-docs.horrible.workers.dev/components/scatter-chart): A relationship between two numeric measures, with every point independently named and positioned. - [Dumbbell Chart](https://comp0-docs.horrible.workers.dev/components/dumbbell-chart): A categorical comparison that shows the start and end of every range on one line. - [Box Plot Chart](https://comp0-docs.horrible.workers.dev/components/boxplot-chart): A distribution summary that shows minimum, quartiles, median, and maximum together. - [Open-to-close Chart](https://comp0-docs.horrible.workers.dev/components/open-to-close-chart): An ordered series that highlights the movement from each opening value to its closing value. - [Lollipop Chart](https://comp0-docs.horrible.workers.dev/components/lollipop-chart): A categorical comparison that pairs a thin value stem with a prominent endpoint. - [Stacked Bar Chart](https://comp0-docs.horrible.workers.dev/components/stacked-bar-chart): A horizontal category comparison divided into consistently ordered segments. - [Stacked Column Chart](https://comp0-docs.horrible.workers.dev/components/stacked-column-chart): A vertical category comparison divided into consistently ordered segments. - [Histogram Chart](https://comp0-docs.horrible.workers.dev/components/histogram-chart): A numeric distribution grouped into adjacent equal-width ranges. - [Heatmap Chart](https://comp0-docs.horrible.workers.dev/components/heatmap-chart): A two-dimensional category matrix whose cells encode a numeric magnitude. - [Sankey Chart](https://comp0-docs.horrible.workers.dev/components/sankey-chart): A directed flow whose link widths show quantities moving between named stages. - [Map Chart](https://comp0-docs.horrible.workers.dev/components/map-chart): A caller-defined SVG map whose state paths carry values and remain keyboard reachable. ## Fields - [Text Area](https://comp0-docs.horrible.workers.dev/components/text-area): A multi-line native text box with the same label and feedback pieces. - [Composer](https://comp0-docs.horrible.workers.dev/components/composer): The message input of a chat: Enter sends, Shift+Enter adds a line, stop interrupts a reply. - [Character Count](https://comp0-docs.horrible.workers.dev/components/character-count): A live, field-linked count of how much text remains before a native length limit. - [Mention Field](https://comp0-docs.horrible.workers.dev/components/mention-field): A multi-line field that completes a token beside the caret without replacing the surrounding message. - [Code Editor](https://comp0-docs.horrible.workers.dev/components/code-editor): A small native code editor that can switch between read-only display and editing. - [Fieldset](https://comp0-docs.horrible.workers.dev/components/fieldset): A native border and name for a related set of controls. - [Text Field](https://comp0-docs.horrible.workers.dev/components/text-field): A shared field brain that connects a label, one text input, help, and errors. - [Password Field](https://comp0-docs.horrible.workers.dev/components/password-field): A hidden-first password input with a built-in show and hide action. - [Search Field](https://comp0-docs.horrible.workers.dev/components/search-field): A labelled search box with an optional erase button. - [Checkbox](https://comp0-docs.horrible.workers.dev/components/checkbox): One tick box or a collection that can have several ticks. - [Radio](https://comp0-docs.horrible.workers.dev/components/radio): A set of choices where one choice wins. - [Switch](https://comp0-docs.horrible.workers.dev/components/switch): An on/off setting backed by a native checkbox. - [Number Field](https://comp0-docs.horrible.workers.dev/components/number-field): A native number box with fully styleable step buttons. - [Slider](https://comp0-docs.horrible.workers.dev/components/slider): A native range control for a value along a track. - [Output](https://comp0-docs.horrible.workers.dev/components/output): The native output element for a result computed from other controls. - [Pin Input](https://comp0-docs.horrible.workers.dev/components/pin-input): A row of one-character fields for entering a short code. - [Range Slider](https://comp0-docs.horrible.workers.dev/components/range-slider): A two-thumb slider for choosing a range between bounds. - [Color Field](https://comp0-docs.horrible.workers.dev/components/color-field): A labelled native color swatch that opens the browser's picker. - [Date Field](https://comp0-docs.horrible.workers.dev/components/date-field): Native date and time inputs with the shared label and feedback pieces. - [Tag Picker](https://comp0-docs.horrible.workers.dev/components/tag-picker): An editable collection that turns chosen options into removable tags. - [Color Swatch Picker](https://comp0-docs.horrible.workers.dev/components/color-swatch-picker): A compact radio group for choosing one named color chip. - [Editable](https://comp0-docs.horrible.workers.dev/components/editable): Plain text that turns into an input when clicked. - [Rating](https://comp0-docs.horrible.workers.dev/components/rating): A star scale built from hidden native radios, one per step. ## Navigation - [Accordion](https://comp0-docs.horrible.workers.dev/components/accordion): A stack of expandable answers. - [Disclosure](https://comp0-docs.horrible.workers.dev/components/disclosure): One button that shows or hides its own extra content. - [Reasoning](https://comp0-docs.horrible.workers.dev/components/reasoning): A collapsed disclosure for a model's reasoning or tool activity, busy while it thinks. - [Tabs](https://comp0-docs.horrible.workers.dev/components/tabs): A set of headings that swaps one panel at a time. - [Breadcrumbs](https://comp0-docs.horrible.workers.dev/components/breadcrumbs): A trail of links showing where this page sits. - [List Box](https://comp0-docs.horrible.workers.dev/components/list-box): A keyboard-friendly list for selecting an item. - [Menu](https://comp0-docs.horrible.workers.dev/components/menu): A compact list of actions opened by a button. - [Tag Group](https://comp0-docs.horrible.workers.dev/components/tag-group): A row of removable, selectable little labels. - [Resizer](https://comp0-docs.horrible.workers.dev/components/resizer): A separator you drag or arrow to resize the thing beside it. - [Connect](https://comp0-docs.horrible.workers.dev/components/connect): Cards with typed inputs and outputs that people can connect, inspect, and disconnect. - [Floating Panel](https://comp0-docs.horrible.workers.dev/components/floating-panel): A persistent non-modal inspector that can move, resize, overlap, and coexist with peer panels. - [Inventory](https://comp0-docs.horrible.workers.dev/components/inventory): A uniform spatial grid whose cards can move and span more rows or columns. - [Grid List](https://comp0-docs.horrible.workers.dev/components/grid-list): A list of rows where each row can hold its own controls. - [Table](https://comp0-docs.horrible.workers.dev/components/table): A native table you can walk cell by cell from the keyboard. - [Comparison](https://comp0-docs.horrible.workers.dev/components/comparison): Options side by side in a real table, so every value is read with its option and feature. - [Tree Grid](https://comp0-docs.horrible.workers.dev/components/tree-grid): A hierarchical table where each row can expand, select, and reveal more columns. - [Skip Link](https://comp0-docs.horrible.workers.dev/components/skip-link): A hidden link that lets keyboard users jump past repeated content. - [Context Menu](https://comp0-docs.horrible.workers.dev/components/context-menu): A menu opened from a right click instead of a button. - [Menubar](https://comp0-docs.horrible.workers.dev/components/menubar): A horizontal bar of menus that behaves like one desktop-style menu strip. - [Tree](https://comp0-docs.horrible.workers.dev/components/tree): A nested list where branches expand and collapse behind one tab stop. - [Carousel](https://comp0-docs.horrible.workers.dev/components/carousel): A labelled strip of slides shown one at a time with previous and next controls. - [Feed](https://comp0-docs.horrible.workers.dev/components/feed): An infinite-scroll list of articles that keyboard users can page through and escape. - [Messages](https://comp0-docs.horrible.workers.dev/components/messages): A named message history that politely announces new messages appended at the end. - [Citation](https://comp0-docs.horrible.workers.dev/components/citation): Numbered inline references that link to a list of sources. - [Message](https://comp0-docs.horrible.workers.dev/components/message): One chat message with its author, time, content, and streaming status. - [BusyRegion](https://comp0-docs.horrible.workers.dev/components/busy-region): Marks content that is still arriving, such as a streamed answer, so comp0 parts inside stay quiet and keep focus where it is. - [Pagination](https://comp0-docs.horrible.workers.dev/components/pagination): A navigation landmark that exposes the current page and page controls. - [Timeline](https://comp0-docs.horrible.workers.dev/components/timeline): A semantic ordered list of events in chronological order. - [Navigation Menu](https://comp0-docs.horrible.workers.dev/components/navigation-menu): A site nav where some links unfold into small panels of more links. - [Steps](https://comp0-docs.horrible.workers.dev/components/steps): A numbered trail through a fixed process, showing one panel at a time. ## Pickers and overlays - [Select](https://comp0-docs.horrible.workers.dev/components/select): A button that opens a list and keeps one chosen value. - [Combobox](https://comp0-docs.horrible.workers.dev/components/combobox): A text box that can also offer matching choices. - [Autocomplete](https://comp0-docs.horrible.workers.dev/components/autocomplete): A provider that gives an existing text field a filtered collection of completions. - [Modal](https://comp0-docs.horrible.workers.dev/components/modal): A complete modal task composed from the Dialog primitives. - [Dialog](https://comp0-docs.horrible.workers.dev/components/dialog): A modal layer that asks people to finish or dismiss a focused task. - [Alert Dialog](https://comp0-docs.horrible.workers.dev/components/alert-dialog): A modal layer for a serious decision that needs attention. - [Popover](https://comp0-docs.horrible.workers.dev/components/popover): A small non-modal layer attached to a trigger. - [Tour](https://comp0-docs.horrible.workers.dev/components/tour): A guided sequence of modal dialogs anchored to existing controls. - [Tooltip](https://comp0-docs.horrible.workers.dev/components/tooltip): A short description revealed from an existing control. - [Calendar](https://comp0-docs.horrible.workers.dev/components/calendar): A month grid for choosing one day with the keyboard or a click. - [Color Picker](https://comp0-docs.horrible.workers.dev/components/color-picker): A custom color picker with a swatch, two-dimensional color area, hue slider, and editable hex value. - [Date Picker](https://comp0-docs.horrible.workers.dev/components/date-picker): A typed date input with a calendar popover sharing one value. - [Time Picker](https://comp0-docs.horrible.workers.dev/components/time-picker): A typed time input with a custom list of useful times. - [Range Calendar](https://comp0-docs.horrible.workers.dev/components/range-calendar): A month grid that selects a start and end date as one range. - [Date Range Picker](https://comp0-docs.horrible.workers.dev/components/date-range-picker): Two typed date inputs and a range calendar sharing one date span. - [Preview](https://comp0-docs.horrible.workers.dev/components/preview): A rich card revealed by pausing on a link. - [Drawer](https://comp0-docs.horrible.workers.dev/components/drawer): An edge-anchored modal panel that slides in and can be swiped away. ## GenUI - [Overview](https://comp0-docs.horrible.workers.dev/genui/overview): GenUI lets a model build an interface from components you choose. Try a seat-price calculator, then use the same code to render a streamed answer. - [Examples](https://comp0-docs.horrible.workers.dev/genui/examples): Send a sample prompt and watch the assistant stream an interactive reply. These 12 recorded conversations run without a model key. Open the response source to see the JSX or JSON behind each one. - [Response payloads](https://comp0-docs.horrible.workers.dev/genui/payloads): Follow two gallery recordings from the model output to the bytes returned by the reply endpoint. - [JSX composition](https://comp0-docs.horrible.workers.dev/genui/server): Extend a composition with a client component and a server data component. The forecast and shader lab uses both in the same answer. - [Styling and motion](https://comp0-docs.horrible.workers.dev/genui/styling): Give generated controls the same spacing, focus states, and motion as the rest of your app. Both renderers use the host’s CSS. - [JSON response format](https://comp0-docs.horrible.workers.dev/genui/format): A response is one JSON object: components with their props inline, containers with children, and shared values a model can bind and compute. - [JSON component catalog](https://comp0-docs.horrible.workers.dev/genui/catalog): Every component a model may compose and the props its schema declares, generated from the catalog that validates responses. - [JSON prompt and schema](https://comp0-docs.horrible.workers.dev/genui/prompt): Teach a model the catalog with a generated system prompt, or hold it to the format with a JSON Schema for structured outputs. - [Browser JSON renderer](https://comp0-docs.horrible.workers.dev/genui/renderer): Render a JSON response as it arrives, handle form submissions, and send validation feedback to the model. - [JSON parser, validator, and store](https://comp0-docs.horrible.workers.dev/genui/utilities): The pieces GenUI is built from, for validating on a server, testing prompts, or building your own renderer. - [Safety and accessibility](https://comp0-docs.horrible.workers.dev/genui/safety): How the host limits what a model can render and how GenUI enforces accessible names. - [@comp0/genui system prompt](https://comp0-docs.horrible.workers.dev/genui.prompt.md): the generated JSON-format prompt that tells a model which comp0 components it may compose and the accessibility, safety, and streaming rules (ships as `@comp0/genui/genui.prompt.md`). ## Optional - [Full documentation for language models](https://comp0-docs.horrible.workers.dev/llms-full.txt): every lesson, component, and GenUI page inlined.