# Okaapi: guide for AI assistants (full) Okaapi is the Okaapi design system: plain CSS tokens and component styles (`@okaapi-ui/css`), with Angular (`@okaapi-ui/angular`) and React (`@okaapi-ui/react`) and Vue (`@okaapi-ui/vue`) components. Accessible (WCAG 2.2 AA, text at 7:1), light and dark, left-to-right and right-to-left (Arabic first-class). 77 documented components in every framework. Site and live demos: https://okaapi.dev/ Pick one framework section below and ignore the others. ## Rules for AI assistants Follow these every time you write code with Okaapi. 1. Use the kit's components and classes. Do not hand-build a button, field, dialog or table that the kit already has. 2. Restyle only through the `--ui-*` tokens and Tailwind classes. Never override a `.ui-*` class, and never copy the kit's CSS into the project. 3. Never invent props, classes or components. If a name is not in this guide, it does not exist: check the component's page on the docs site. 4. Use colour tokens, never raw hex values: `bg-primary`, `text-on-primary`, `var(--ui-primary)`. Colours switch with the theme (`data-theme="light"` or `"dark"`, or the system setting). 5. Space comes from the scale: `p-4`, `gap-3`, `ui-p-4` (without Tailwind). Do not write pixel values. 6. Use logical properties (`ms-2`, `pe-4`, `start`, `end`), never `left` or `right`, so the layout flips in right-to-left languages. 7. Always set `lang` and `dir` on ``. In an Arabic app give the components their Arabic words in one place, switched with the language: `provideUiLabels(arabicLabels)` (Angular providers; Vue in App.vue setup) or `` (React). Do not set close, remove or pagination labels one by one. Write your own labels in Arabic too. 8. Every control needs a visible label. Colour never carries meaning alone: an error also has text. 9. Put your own CSS in `@layer components` or `@layer base`, or a plain rule beats the kit's classes. 10. Open native dialogs with `showModal()`, never `show()`. 11. Angular: components are standalone, import each one in `imports`. Use signals and the new control flow (`@if`, `@for`). React: React 19, function components. Vue: Vue 3.5 with ` ``` See [Getting started](https://okaapi.dev/getting-started) for the rest. ## Components (Vue 3) ### Accordion A stack of sections that open and close, such as questions and answers. Built on the native details element, so it opens with Enter and Space, works without script, and the browser's find-in-page opens the section that holds the match. Sections grow and shrink smoothly both ways, Up and Down move between the headings, and the chevron mirrors in Arabic. Docs: https://okaapi.dev/components/accordion ```ts import { Accordion, AccordionItem } from '@okaapi-ui/vue'; ``` When to use something else: - Switch between views of the same thing, one at a time: [Tabs](https://okaapi.dev/components/tabs) - Hide one optional detail behind a button: [Popover](https://okaapi.dev/components/popover) - Show steps the reader must go through in order: [Stepper](https://okaapi.dev/components/stepper) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `single` | `boolean` | `false` | On Accordion: one section open at a time. | | `icon` | `'end' \| 'start' \| 'none'` | `'end'` | On Accordion, or one AccordionItem: where the chevron sits. | | `#heading` | `slot` | | Required, on AccordionItem: what opens it. | | `description` | `string` | | On AccordionItem: a quieter line under the heading. | | `open, defaultOpen` | `boolean` | | On AccordionItem: controlled, or open at first. Closing runs its motion. | | `disabled` | `boolean` | `false` | On AccordionItem: focusable and announced, but it does not open. | | `lazy` | `boolean` | `false` | On AccordionItem: renders the slot when it opens. | | `keep` | `boolean` | `false` | On AccordionItem: keeps lazy children once mounted. Off, they unmount once closed. | Keyboard and screen readers: - Enter or Space: Open or close the section. - Up or Down: Move to the previous or next heading, wrapping round. - Home or End: Go to the first or last heading. - Native details elements: they open without script, and find in page opens the section that holds the match. - In plain HTML only the Up, Down, Home and End keys need script. ### Alert dialog A short message that needs an answer before the reader goes on: confirm a delete, keep or discard changes. Only its buttons answer: Escape and a click outside do nothing, because the reader has to choose. Focus starts on the safest button. Docs: https://okaapi.dev/components/alert-dialog ```ts import { useAlertDialog } from '@okaapi-ui/vue'; const { alert, confirm, dialog } = useAlertDialog(); // render once in the template, then await alert() or confirm() ``` When to use something else: - Ask for more than a yes or no, such as a form: [Dialog](https://okaapi.dev/components/dialog) - Confirm something that can be undone: [Toast with an Undo action](https://okaapi.dev/components/toast) - Warn about something on the page without stopping the reader: [Alert](https://okaapi.dev/components/alert) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `useAlertDialog()` | `{ alert, confirm, dialog }` | | Render dialog once; alert() and confirm() return promises. | | `alert(options)` | `Promise` | | The value of the pressed action. | | `confirm(options)` | `Promise` | | true only when the confirm button is pressed. | | `options` | `object` | | title, message, tone and actions; confirmLabel, cancelLabel and danger for confirm. | | `` | `component` | | The same dialog, controlled: open, the options, and @action, which gets the value. | Keyboard and screen readers: - Tab or Shift + Tab: Move between its buttons; focus stays inside. - Escape and a click outside do nothing: only its buttons answer. - Focus starts on the safest button, and the title and message are read when it opens. ### Alert A message in the page, such as a problem with the whole form or a notice about the account. The title says what it is in words; the icon's shape and the colour repeat it. For a note after an action, use a toast; for a question that needs an answer, an alert dialog. Docs: https://okaapi.dev/components/alert ```ts import { Alert } from '@okaapi-ui/vue'; ``` When to use something else: - Confirm an action that just finished: [Toast](https://okaapi.dev/components/toast) - Stop the reader until they decide: [Alert dialog](https://okaapi.dev/components/alert-dialog) - Show a status in a row or a card: [Badge](https://okaapi.dev/components/badge) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `tone` | `'info' \| 'success' \| 'warning' \| 'danger'` | `'info'` | Icon and colour. The title must say it too. | | `title` | `string` | | A few words in bold that say what it is. | | `#actions` | `slot` | | Buttons under the message. | | `@dismiss` | `event` | | Listening shows a close button; remove the alert when it fires. | | `closeLabel` | `string` | `'Dismiss' from labels` | Its accessible name, translated. | Keyboard and screen readers: - The title says what it is in words; the icon and the colour only repeat it. ### App shell The frame every screen of an app sits in: a header across the top, the main links in a side bar, the page beside them. When the shell is narrower than 64rem the side bar folds behind a menu button and opens over the page. Escape, the shade, or following a link closes it again. Docs: https://okaapi.dev/components/app-shell ```ts import { AppShell, Nav } from '@okaapi-ui/vue'; ``` When to use something else: - Links in a side bar only, inside your own layout: [Navigation](https://okaapi.dev/components/nav) - Show where the page sits in the site: [Breadcrumbs](https://okaapi.dev/components/breadcrumbs) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `menuLabel` | `string` | `Menu from labels` | Names the menu button. Translate it. | | `mainId` | `string` | `main` | The id of the page area, for a "Skip to content" link. | | `landmarks` | `boolean` | `true` | The header is the banner and the page the main landmark. Off inside a page that has them. | | `#brand \| #actions \| #sidebar` | `slot` | | The header's name and controls, and the side bar's navigation. The default slot is the page. | Keyboard and screen readers: - Enter or Space: On the menu button, open the side bar on a narrow screen. - Escape: Close the side bar. - The header, the side bar and the page are landmarks, so screen readers can jump between them. ### Area chart How much, over time: one amount, or parts that add up to a whole. Stacked parts have a texture as well as a colour, and one button shows the same numbers as a table. Docs: https://okaapi.dev/components/area-chart ```ts import { AreaChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - Several values to compare over time: [Line chart](https://okaapi.dev/components/line-chart) - Amounts of separate things: [Bar chart](https://okaapi.dev/components/bar-chart) - Parts of one whole, at one moment: [Pie chart](https://okaapi.dev/components/pie-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `x` | `string` | | Required. The row field with the place: text, a number or a Date (read in UTC). | | `series` | `ChartSeries[]` | | Required. The values: key, label, and optionally color (1 to 4 or muted). | | `layout` | `'overlap' \| 'stacked' \| 'percent'` | `'overlap'` | Over each other, on top of each other, or as shares of a whole. | | `curve` | `'straight' \| 'smooth' \| 'step'` | `'straight'` | How values are joined. | | `highlight` | `string` | | What to bring forward; the rest turns grey. | | `references` | `ChartReference[]` | `[]` | Levels to compare with: value and label. | | `xLabel` | `string` | | Names the axis of places, and the first table column. | | `yLabel` | `string` | | Names the axis of values. | | `yMin` | `number` | | Where the values start. Defaults to zero or lower. | | `yMax` | `number` | | Where the values end. | | `formatX` | `(x) => string` | | Writes a place. | | `formatY` | `(y: number) => string` | | Writes a value, in the axis, the tooltip and the table. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `toggle` | `boolean` | `false` | The names become buttons that switch parts on and off. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `patterns` | `boolean` | `true` | Textures over the colours, so shapes differ without colour. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Stacked parts differ by texture as well as colour; overlapping ones by the dash of their edge. ### Avatar group Several people in a small space: the first few avatars overlap and a '+3' stands for the rest. The group has a name, every avatar is still named, and '+3' is read as '3 more'. Docs: https://okaapi.dev/components/avatar-group ```ts import { AvatarGroup } from '@okaapi-ui/vue'; ``` When to use something else: - One person: [Avatar](https://okaapi.dev/components/avatar) - Every name visible, such as a list of attendees: [A list or Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Who the group is, for screen readers. | | `people` | `AvatarPerson[]` | | Required. { name, src? } for each person, in order. | | `max` | `number` | `4` | How many avatars to show before "+n". | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Size of every avatar. | | `moreLabel` | `(count: number) => string` | `(n) => `${n} more` from labels` | The spoken name of "+n". Translate it. | Keyboard and screen readers: - The group has a name, every avatar is still named, and +3 is read as 3 more. ### Avatar A person's photo, or their initials when there is no photo or it fails to load. Screen readers hear the person's name, never the file name. Docs: https://okaapi.dev/components/avatar ```ts import { Avatar } from '@okaapi-ui/vue'; ``` When to use something else: - Show several people in a small space: [Avatar group](https://okaapi.dev/components/avatar-group) - Show a status next to a person, such as online: [Status dot](https://okaapi.dev/components/status-dot) - A logo or a product picture: A plain img with alt text | Name | Type | Default | What it does | | --- | --- | --- | --- | | `name` | `string` | | Required. Read by screen readers and turned into the initials. | | `src` | `string` | | The photo. Initials show while it is missing or broken. | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 32, 40 or 56 pixels. | | `decorative` | `boolean` | `false` | Hides it from screen readers, for when the name is on screen next to it. | Keyboard and screen readers: - Screen readers hear the person’s name, never the file name. ### Badge A short status label, such as the state of an order. The words carry the meaning and the colour only repeats it, so every status reads the same without colour. Docs: https://okaapi.dev/components/badge ```ts import { Badge } from '@okaapi-ui/vue'; ``` When to use something else: - A label the user added or can remove, such as a filter: [Tag](https://okaapi.dev/components/tag) - A live state such as online or offline: [Status dot](https://okaapi.dev/components/status-dot) - A message the reader must read: [Alert](https://okaapi.dev/components/alert) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `variant` | `'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | The colour. The text must say the status too. | Keyboard and screen readers: - The words carry the status; the colour only repeats them. ### Bar chart Amounts to compare, as lengths from zero. Side by side, stacked, or as shares of a whole, upright or sideways. Each series has a texture as well as a colour, and one button shows the same numbers as a table. Docs: https://okaapi.dev/components/bar-chart ```ts import { BarChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - How a value changes over time: [Line chart](https://okaapi.dev/components/line-chart) - Parts of one whole, up to five: [Pie chart](https://okaapi.dev/components/pie-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) - One level inside a known range: [Meter](https://okaapi.dev/components/meter) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `x` | `string` | | Required. The row field with the place: text, a number or a Date (read in UTC). | | `series` | `ChartSeries[]` | | Required. The values: key, label, and optionally color (1 to 4 or muted). | | `layout` | `'grouped' \| 'stacked' \| 'percent'` | `'grouped'` | Side by side, on top of each other, or as shares of a whole. | | `horizontal` | `boolean` | `false` | Bars run along the reading direction. | | `sort` | `'ascending' \| 'descending'` | | By the total of each row. | | `valueLabels` | `boolean` | `false` | Writes each value, or the total of each stack. Not for bars side by side. | | `highlight` | `string` | | What to bring forward; the rest turns grey. | | `references` | `ChartReference[]` | `[]` | Levels to compare with: value and label. | | `xLabel` | `string` | | Names the axis of places, and the first table column. | | `yLabel` | `string` | | Names the axis of values. | | `yMin` | `number` | | Where the values start. Defaults to zero or lower. | | `yMax` | `number` | | Where the values end. | | `formatX` | `(x) => string` | | Writes a place. | | `formatY` | `(y: number) => string` | | Writes a value, in the axis, the tooltip and the table. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `toggle` | `boolean` | `false` | The names become buttons that switch parts on and off. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `patterns` | `boolean` | `true` | Textures over the colours, so shapes differ without colour. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Bars differ by texture as well as colour, and a gap separates the parts of a stack. ### Bottom sheet A panel that slides up from the bottom of the screen, for a short choice or the details of an item, mostly on phones. It is a dialog docked to the bottom: focus moves into it and stays there, the page behind stops scrolling, and Escape, the close button or a click above it closes it. Docs: https://okaapi.dev/components/bottom-sheet ```ts import { Dialog } from '@okaapi-ui/vue'; ``` When to use something else: - A task on a wide screen: [Dialog](https://okaapi.dev/components/dialog) - Navigation or filters that slide in from the side: [Drawer](https://okaapi.dev/components/drawer) - A short list of actions: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `variant` | `'default' \| 'alert' \| 'drawer' \| 'sheet'` | `'default'` | 'sheet': docked to the bottom. | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Its width on a wide screen: 24, 32 or 48rem. The full width on a phone. | | `everything else` | `Dialog API` | | title, description, v-model:open, #actions, dismissable and closeLabel work as in the dialog. | Keyboard and screen readers: - Tab or Shift + Tab: Move between the controls inside; focus stays inside. - Escape: Close, and put focus back on the button that opened it. - A dialog docked to the bottom, named by its title; the page behind stops scrolling. ### Box plot How values spread in each group. The box is the middle half, the thick line the median, the thin lines the rest, and a ring each value far from it. One button shows every number as a table. Docs: https://okaapi.dev/components/box-chart ```ts import { BoxChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - One list of values: [Histogram](https://okaapi.dev/components/histogram-chart) - One amount for each group: [Bar chart](https://okaapi.dev/components/bar-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `group` | `string` | | Required. The row field with the group. | | `value` | `string` | | Required. The row field with the number. | | `outliers` | `boolean` | `true` | A ring for each value far from the rest. | | `highlight` | `string` | | The group to bring forward; the others turn grey. | | `xLabel` | `string` | | Names the axis of groups, and the first table column. | | `yLabel` | `string` | | Names the axis of values. | | `yMin` | `number` | | Where the values start. | | `yMax` | `number` | | Where the values end. | | `formatValue` | `(value: number) => string` | | Writes a number. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - The five numbers of each box are announced together. ### Breadcrumbs Where the page sits, as a trail of links back up. A named navigation landmark around an ordered list; the last item is the page itself, marked as current and not a link. The slashes are drawn, not read out. Docs: https://okaapi.dev/components/breadcrumbs ```ts import { Breadcrumbs } from '@okaapi-ui/vue'; ``` When to use something else: - The main links of the app: [Navigation](https://okaapi.dev/components/nav) - Steps of a task in order: [Stepper](https://okaapi.dev/components/stepper) - Pages of a long list: [Pagination](https://okaapi.dev/components/pagination) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | `'Breadcrumb' from labels` | Names the landmark, translated. | | `default slot` | `slot` | | One per step; the last holds aria-current="page". | Keyboard and screen readers: - A named navigation landmark around an ordered list; the last item is marked as the current page. - The slashes are drawn, not read out. ### Button group Buttons that belong together, joined into one bar. The group has a name, so a screen reader says what the buttons are for before it reads them. Docs: https://okaapi.dev/components/button-group ```ts import { Button, ButtonGroup } from '@okaapi-ui/vue'; ``` When to use something else: - One choice that changes the view: [Segmented control](https://okaapi.dev/components/segmented-control) - Many controls with arrow-key movement, as in an editor: [Toolbar](https://okaapi.dev/components/toolbar) - More actions than fit on a phone: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. What the buttons do together, for screen readers. | | `#default` | `slot` | | The buttons. | Keyboard and screen readers: - Tab: Move from button to button. - A named group, read before its buttons. ### Button Styles the native button, so it keeps everything the browser gives a button: focus, Enter and Space, form submit. Nine variants, three sizes, icons, and hover, press and focus feedback. Docs: https://okaapi.dev/components/button ```ts import { Button } from '@okaapi-ui/vue'; ``` When to use something else: - Go to another page: A link (a href) - A state that stays on or off, such as bold: [Toggle](https://okaapi.dev/components/toggle) - Several actions that belong together: [Button group](https://okaapi.dev/components/button-group) - More actions than fit, behind one button: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'danger' \| 'outline' \| 'soft' \| 'link' \| 'success' \| 'warning'` | `'primary'` | How much the button stands out. | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Padding and text size. Height never drops under 44 pixels. | | `loading` | `boolean` | `false` | Disables the button, sets aria-busy and shows a spinner. | | `#startIcon / endIcon` | `slot` | | Icon before or after the label. The spinner replaces startIcon while loading. | | `iconOnly` | `boolean` | `false` | Square button for a lone icon. Add an aria-label. | Keyboard and screen readers: - Enter or Space: Press the button. - A native button, so its role, focus and form submit come from the browser. - A button with only an icon needs a label in words for screen readers. ### Calendar A month grid to pick a day or a range, such as a delivery day or a stay. One Tab stop: arrow keys move by day and week, Home and End go to the ends of the week, Page Up and Page Down change the month, with Shift the year. Each day is read in full, Thursday, 19 November 2026. Today is underlined and picked days are filled, so neither depends on colour. Use it when seeing the month helps: open and closed days, a range, or the weekday. For a date people already know, such as a birthday, use the date field. Docs: https://okaapi.dev/components/calendar ```ts import { Calendar, RangeCalendar, type DateRange } from '@okaapi-ui/vue'; // Dates are ISO strings (YYYY-MM-DD). Language follows lang on . ``` When to use something else: - A date the reader already knows, such as a birthday: [Date picker](https://okaapi.dev/components/date-picker) - A time or a date and time: [Text field with type time](https://okaapi.dev/components/text-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Names the calendar for screen readers. Required. | | `min \| max` | `string` | | Earliest and latest days that can be picked, as YYYY-MM-DD. | | `isDisabled` | `(date: string) => boolean` | | Other days that can not be picked, such as closed days. | | `v-model` | `string \| null` | | The chosen day as an ISO date ("2026-11-23"). | | `RangeCalendar v-model` | `DateRange` | | { start, end } in ISO dates, set once both days are picked. | Keyboard and screen readers: - Tab: Reach the grid, on the chosen or focused day. - Left or Right: Move by a day. Flipped in Arabic. - Up or Down: Move by a week. - Home or End: Go to the start or end of the week. - Page Up or Page Down: Go to the previous or next month. - Shift + Page Up or Shift + Page Down: Go to the previous or next year. - Enter or Space: Pick the day. - Each day is read in full, such as Thursday, 19 November 2026. - Today is underlined and picked days are filled, so neither depends on colour. ### Candlestick chart Where a price opened and closed, and how far it went, each day. A rising day is hollow and a falling one filled, so colour only repeats it. One button shows the four prices as a table. Docs: https://okaapi.dev/components/candlestick-chart ```ts import { CandlestickChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - Only the closing price: [Line chart](https://okaapi.dev/components/line-chart) - How values spread in groups: [Box plot](https://okaapi.dev/components/box-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `x` | `string` | | Required. The row field along the bottom: a Date or text. | | `open` | `string` | `'open'` | The row field with the price at the start. | | `high` | `string` | `'high'` | With the highest price. | | `low` | `string` | `'low'` | With the lowest price. | | `close` | `string` | `'close'` | With the price at the end. | | `average` | `number` | | A line through the average of this many closing prices. | | `references` | `ChartReference[]` | `[]` | Named levels: value and label. | | `xLabel` | `string` | | Names the bottom axis, and the first table column. | | `yLabel` | `string` | | Names the side axis. | | `formatX` | `(x) => string` | | Writes a day. | | `formatY` | `(y: number) => string` | | Writes a price. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Rising days are hollow and falling days filled, as well as two colours. ### Card A surface that groups related content: a summary, a list, a form. Cards are flat, with a thin border; shadows are kept for things that float, like menus and dialogs. Docs: https://okaapi.dev/components/card ```ts import { Card } from '@okaapi-ui/vue'; ``` When to use something else: - Separate two groups with a line only: [Divider](https://okaapi.dev/components/divider) - Label and value pairs, such as order details: [Property list](https://okaapi.dev/components/property-list) - One number and how it changed: [Stat](https://okaapi.dev/components/stat) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `title` | `string` | | Optional heading at the top of the card. | | `level` | `2 \| 3 \| 4` | `3` | The heading level of the title. | | `padding` | `'md' \| 'lg'` | `'md'` | 1.5rem or 2rem inside the border. | Keyboard and screen readers: - A card with a heading reads as its own part of the page; give it one when it stands alone. ### Checkbox A yes or no that is saved with the form, such as accepting the terms. The native checkbox in the primary colour; the whole label is the hit area, at least 44px tall. Docs: https://okaapi.dev/components/checkbox ```ts import { Checkbox } from '@okaapi-ui/vue'; // Bind it with v-model; every other attribute goes to the input: name, required. ``` When to use something else: - One choice from a few options: [Radio group](https://okaapi.dev/components/radio-group) - A setting that takes effect at once: [Switch](https://okaapi.dev/components/switch) - Several choices from a long list: [Combobox or Chip input](https://okaapi.dev/components/chip-input) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. The visible label. | | `hint` | `string` | | Help text, read with the checkbox. | | `error` | `string` | | The translated error. Marks it invalid and announces the message. | | `indeterminate` | `boolean` | `false` | Shows a dash: some of the items under it are ticked. | | `testId` | `string` | | data-testid on the input. | Keyboard and screen readers: - Space: Tick or untick it. - The native checkbox, named by its label; the whole label is the hit area. ### Chip input A text field that collects several short values, such as toppings, email addresses or skills. Each value becomes a tag with its own named remove button. Screen readers hear each value being added and removed, and focus never falls off the field. Docs: https://okaapi.dev/components/chip-input ```ts import { ChipInput } from '@okaapi-ui/vue'; ``` When to use something else: - One value from a known list: [Combobox](https://okaapi.dev/components/combobox) - A few choices that fit on screen: [Checkbox](https://okaapi.dev/components/checkbox) - Show labels the user cannot type: [Tag](https://okaapi.dev/components/tag) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the field and the list of tags. | | `hint \| placeholder` | `string` | | Help under the field; text in the empty field. | | `removeLabel` | `string` | `'Remove' from labels` | First word of each × button's name. Translate it. | | `addedLabel \| removedLabel` | `(chip: string) => string` | ``${c} added` from labels` | What screen readers hear after a change. Translate them. | | `v-model` | `string[]` | | The chips, in the order they were added. | | `disabled` | `boolean` | `false` | Locks the field and hides the × buttons. | Keyboard and screen readers: - Enter or ,: Add what is typed as a tag. - Backspace: In an empty field, move to the last tag’s remove button. - Enter or Space: On a remove button, remove that tag. - Each tag has its own remove button, named after its value. - Adding and removing are announced, and focus moves to the next tag or back to the field. ### Combo chart Bars with a line over them, on one scale: what happened beside what it is measured against. One scale only: two would make any two lines look related. One button shows the same numbers as a table. Docs: https://okaapi.dev/components/combo-chart ```ts import { ComboChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - Only amounts to compare: [Bar chart](https://okaapi.dev/components/bar-chart) - Only change over time: [Line chart](https://okaapi.dev/components/line-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `x` | `string` | | Required. The row field along the bottom. | | `series` | `ComboSeries[]` | | Required. The values: key, label, as ('bar' or 'line'), and optionally color. | | `stacked` | `boolean` | `false` | The bars on top of each other. | | `curve` | `'straight' \| 'smooth' \| 'step'` | `'straight'` | How the line joins its values. | | `references` | `ChartReference[]` | `[]` | Levels to compare with: value and label. | | `xLabel` | `string` | | Names the axis of places, and the first table column. | | `yLabel` | `string` | | Names the axis of values. | | `yMin` | `number` | | Where the values start. Defaults to zero or lower. | | `yMax` | `number` | | Where the values end. | | `formatX` | `(x) => string` | | Writes a place. | | `formatY` | `(y: number) => string` | | Writes a value, in the axis, the tooltip and the table. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `toggle` | `boolean` | `false` | The names become buttons that switch parts on and off. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `patterns` | `boolean` | `true` | Textures over the colours, so shapes differ without colour. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Bars and lines differ by their form; bars by texture and lines by dash as well as colour. ### Combobox A text field that filters a list as you type, for a long list such as countries. Focus stays in the field: arrow keys move through the matches, Enter picks one and Escape closes the list. The value is always one of the options. Docs: https://okaapi.dev/components/combobox ```ts import { Combobox } from '@okaapi-ui/vue'; ``` When to use something else: - One choice from fewer than about 10 options: [Select](https://okaapi.dev/components/select) - Several values: [Chip input](https://okaapi.dev/components/chip-input) - Find a page or run a command from anywhere: [Command palette](https://okaapi.dev/components/command-palette) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the field and the list. | | `options` | `SelectOption[]` | | Required. { value, label, disabled? }. | | `v-model` | `T \| null` | | The chosen value, controlled or not. | | `placeholder, hint, error` | `string` | | As for the text field. | | `emptyText` | `string` | `'No matches' from labels` | Announced when nothing matches. | | `disabled` | `boolean` | | Disables the field. | | `name` | `string` | | Sends the value with a native form. | | `testId` | `string` | | data-testid on the input; options get -option-. | Keyboard and screen readers: - Up or Down: Open the list and move through the matches, wrapping round. - Enter: Pick the highlighted match. - Escape: Close the list. - Focus stays in the field; the highlighted match is read as it moves. ### Command palette A search over the app's actions, in a dialog. Ctrl+K or ⌘K opens it from anywhere; typing filters, the arrow keys move and Enter runs. Screen readers hear how many commands match as you type. Keep a visible button for it too: a shortcut nobody knows about is no way in. Docs: https://okaapi.dev/components/command-palette ```ts import { CommandPalette, type Command } from '@okaapi-ui/vue'; ``` When to use something else: - Pick a value inside a form: [Combobox](https://okaapi.dev/components/combobox) - Search the items of one list: [Search field](https://okaapi.dev/components/search-field) - A few actions on one thing: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `commands` | `Command[]` | | Required. { id, label, keywords?, shortcut? }. Keywords find a command by other words; shortcut is only shown. | | `shortcut` | `string \| null` | `'k'` | The letter that opens it with Ctrl or ⌘. null turns it off. | | `title \| placeholder` | `string` | `'Commands' from labels` | Names the dialog and the field; text in the empty field. | | `emptyLabel \| closeLabel` | `string` | | Shown when nothing matches; the close button. Translate them. | | `countLabel` | `(count: number) => string` | ``${n} commands` from labels` | Announced as you type. Translate it. | | `v-model:open` | `boolean` | | Required. Set to false by Escape, the backdrop or a run command. | | `@run` | `event` | | Gets the chosen command, after the palette has closed. | Keyboard and screen readers: - Ctrl + K or ⌘ + K: Open it from anywhere. - Up or Down: Move through the matching commands, wrapping round. - Enter: Run the highlighted command. - Escape: Close it. - How many commands match is announced as you type. - Keep a visible button for it too: a shortcut nobody knows about is no way in. ### Context menu Actions that open where the reader right-clicks, long-presses, or presses Shift+F10 on the focused item. It is a shortcut: the same actions must also be somewhere visible, because touch and keyboard users rarely look for one. Docs: https://okaapi.dev/components/context-menu ```ts import { ContextMenu } from '@okaapi-ui/vue'; ``` When to use something else: - The visible way to the same actions: [Menu](https://okaapi.dev/components/menu) - Actions that should always be on screen: [Toolbar](https://okaapi.dev/components/toolbar) - Search every command in the app: [Command palette](https://okaapi.dev/components/command-palette) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `items` | `MenuAction[]` | | Required. { id, label, danger?, disabled? } for each action. | | `@action` | `(id: string) => void` | | The chosen action's id; the menu then closes. | | `disabled` | `boolean` | `false` | Right-click shows the browser menu instead. | | `#default` | `slot` | | The area that opens the menu. Make it focusable. | Keyboard and screen readers: - Shift + F10 or Menu: Open the menu on the focused item. - Up or Down: Move through the actions. - Enter or Space: Run the action. - Escape: Close it. - It is a shortcut: the same actions must also be somewhere visible. ### Data table Rows of records the reader scans and compares: orders, users, payments. A real table, named by its caption, so screen readers announce the row and column of every cell. Sorting is announced too. Docs: https://okaapi.dev/components/data-table ```ts import { DataTable, type TableColumn, type TableSort } from '@okaapi-ui/vue'; ``` When to use something else: - A few label and value pairs: [Property list](https://okaapi.dev/components/property-list) - Events in time order: [Timeline](https://okaapi.dev/components/timeline) - Nested items such as folders: [Tree](https://okaapi.dev/components/tree) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `caption` | `string` | | Required. Names the table; screen readers announce it. | | `hideCaption` | `boolean` | `false` | Keep the caption for screen readers only. | | `columns` | `TableColumn[]` | | Required. { key, header, sortable?, align?, value? } per column; a #cell- slot gets { row } and replaces the text. | | `rows` | `T[]` | | Required. The rows of the current page. | | `v-model:sort` | `TableSort \| null` | | The sort state, controlled. Sort the rows yourself. | | `rowKey` | `keyof T \| (row) => Key` | | Used as the key of each row. | | `loading / loadingLabel` | `boolean / string` | `false / 'Loading'` | Marks the table busy and reads the label once. | | `emptyMessage` | `string` | `'No results' from labels` | Shown when there are no rows; pass the translated text. | Keyboard and screen readers: - Enter or Space: On a column heading, sort by it. - A real table named by its caption, so the row and column of every cell are read. - The sorted column is marked, and the new order is announced. ### Date picker A date to type or pick, or a range of dates for a stay. Type dates in the reader's own order, or open the calendar beside them or with Alt + Down. Unlike the browser's own picker, this calendar can close off days, such as a shop's day off. For ordinary dates and times, the native fields below use the browser's localized pickers. Date values stay plain ISO dates. Docs: https://okaapi.dev/components/date-picker ```ts import { DatePicker, TextField } from '@okaapi-ui/vue'; ``` When to use something else: - Pick days by looking at a month, or a range: [Calendar](https://okaapi.dev/components/calendar) - A time only: [Text field with type time](https://okaapi.dev/components/text-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Names the field and the calendar. | | `min \| max` | `string` | | Earliest and latest dates, as YYYY-MM-DD. | | `isDisabled` | `(date: string) => boolean` | | Days that cannot be picked, such as closed days. | | `hint \| error` | `string` | | Help text, and the translated error that marks it invalid. | | `calendarLabel` | `string` | `Choose date from labels` | Names the calendar button. Translate it. | | `selection` | `'single' \| 'range'` | `'single'` | range types a start and an end date and picks both in the calendar. | | `rangeStartLabel \| rangeEndLabel` | `string` | | Accessible names of the two date inputs in a range; pass the translated text. | | `v-model` | `string \| DateRange \| null` | | An ISO date ("2026-11-23"), or { start, end } for a range; null while incomplete. | | `disabled \| name` | `boolean \| string` | | As on any input. | Keyboard and screen readers: - Alt + Down: Open the calendar from the field. - Escape: Close the calendar, and put focus back on the field. - The fields take dates typed in the reader’s own order; the calendar keys are listed on the Calendar page. ### Dialog A modal window for a task that needs the reader's full attention: a short form, details, terms. Focus moves into it and stays there, the page behind stops scrolling, and Escape, the close button or a click outside closes it. Docs: https://okaapi.dev/components/dialog ```ts import { Dialog } from '@okaapi-ui/vue'; ``` When to use something else: - A yes or no question that must be answered: [Alert dialog](https://okaapi.dev/components/alert-dialog) - Content beside the page, such as filters: [Drawer](https://okaapi.dev/components/drawer) - A short note next to the button: [Popover](https://okaapi.dev/components/popover) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `title` | `string` | | Required. The heading; it names the dialog. | | `v-model:open` | `boolean` | | Required. Set to false by Escape, the backdrop or the close button. | | `description` | `string` | | A sentence under the title, read with it. | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 24, 32 or 48rem wide, never wider than the screen. | | `#actions` | `slot` | | The buttons; they line up at the end and stay in view. | | `dismissable` | `boolean` | `true` | false: only your own buttons close it. Escape and a click outside do nothing, and the close button is hidden. | | `closeLabel` | `string` | `'Close' from labels` | Accessible name of the close button; pass the translated text. | Keyboard and screen readers: - Tab or Shift + Tab: Move between the controls inside; focus stays inside. - Escape: Close, and put focus back on the button that opened it. - Named by its title; the page behind stops scrolling and cannot be reached. ### Divider A thin line between groups of content. Reach for space first: a divider is for when space alone does not show where one group ends. Docs: https://okaapi.dev/components/divider ```ts import { Divider } from '@okaapi-ui/vue'; ``` When to use something else: - A frame around a group: [Card](https://okaapi.dev/components/card) - Space between groups: Tailwind gap or margin classes | Name | Type | Default | What it does | | --- | --- | --- | --- | | `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Which way the line runs. | | `label` | `string` | | Words in the middle of the line, read as text. Horizontal only. | Keyboard and screen readers: - Read as a separator; a divider with words in the middle is read as those words instead. ### Drawer A side panel that slides in from the edge, for a form or the details of a row, while the list stays in sight. It is a dialog docked to the side: focus moves into it and stays there, the page behind stops scrolling, only the body scrolls, and Escape, the close button or a click outside closes it. Docs: https://okaapi.dev/components/drawer ```ts import { Dialog } from '@okaapi-ui/vue'; ``` When to use something else: - A focused task in the middle of the screen: [Dialog](https://okaapi.dev/components/dialog) - A panel on a phone: [Bottom sheet](https://okaapi.dev/components/bottom-sheet) - The main links of the app on a phone: [App shell](https://okaapi.dev/components/app-shell) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `variant` | `'default' \| 'alert' \| 'drawer'` | `'default'` | 'drawer': full height on the inline end. | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 24, 32 or 48rem wide; the full width on a phone. | | `everything else` | `Dialog API` | | title, description, v-model:open, #actions, dismissable and closeLabel work as in the dialog. | Keyboard and screen readers: - Tab or Shift + Tab: Move between the controls inside; focus stays inside. - Escape: Close, and put focus back on the button that opened it. - A dialog docked to the side, named by its title; the page behind stops scrolling. ### Empty state What a list, table or page shows while it has nothing in it. It says what will appear here, why it is empty now, and offers the one action that fills it. Docs: https://okaapi.dev/components/empty-state ```ts import { EmptyState } from '@okaapi-ui/vue'; ``` When to use something else: - Content that is still loading: [Skeleton](https://okaapi.dev/components/skeleton) - Something went wrong: [Alert](https://okaapi.dev/components/alert) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `title` | `string` | | Required. What is missing, as a heading. | | `level` | `2 \| 3 \| 4` | `3` | Heading level of the title, so it fits the page outline. | | `#actions` | `slot` | | The action that fills the space. One, usually. | Keyboard and screen readers: - Its title is a heading, at the level you set so it fits the page outline. ### Fieldset A titled group of fields inside a longer form. Screen readers read the legend as they enter the group, so a field called Street is heard as part of the delivery address. Docs: https://okaapi.dev/components/fieldset ```ts import { Fieldset } from '@okaapi-ui/vue'; ``` When to use something else: - A frame around content that is not a form: [Card](https://okaapi.dev/components/card) - One choice from a few, with a group label: [Radio group](https://okaapi.dev/components/radio-group) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `legend` | `string` | | Required. The group title. | | `hint` | `string` | | A line under the legend, read with the group. | Keyboard and screen readers: - The legend is read when focus enters the group, so each field is heard as part of it. ### File field The browser's own file input, with a label, hint and error, in a zone that also takes files dropped on it. The native button and file names stay, so it works with the keyboard, screen readers and phone cameras as usual. Docs: https://okaapi.dev/components/file-field ```ts import { FileField } from '@okaapi-ui/vue'; // @files gets a File[] for a pick or a drop. Every other attribute goes to the input. ``` When to use something else: - Typed text or a link to a file: [Text field](https://okaapi.dev/components/text-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. The visible label. | | `@files` | `event` | | Called after a pick or a drop. | | `hint, error, dropText` | `string` | | As for the text field; dropText is the line under the button, translated. | | `testId` | `string` | | data-testid on the input. | Keyboard and screen readers: - Enter or Space: Open the file chooser. - The browser’s own file input: the button and the chosen file names are read as usual. - Dropping files is a shortcut; the button always works. ### Funnel chart How many are left after each step: visits, baskets, orders. Every step says its number and its share of the first, so the width only repeats it. One button shows it as a table. Docs: https://okaapi.dev/components/funnel-chart ```ts import { FunnelChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - Amounts that are not steps: [Bar chart](https://okaapi.dev/components/bar-chart) - Steps the reader goes through: [Stepper](https://okaapi.dev/components/stepper) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `name` | `string` | | Required. The row field with the step's name. | | `value` | `string` | | Required. The row field with its number. | | `highlight` | `string` | | The name of the step to bring forward; the others turn grey. | | `formatValue` | `(value: number) => string` | | Writes a number. | | `nameLabel` | `string` | | Names the first column of the table. | | `valueLabel` | `string` | | Names the second. Defaults to Value. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - The number and share of each step are written beside it. ### Gauge chart One level inside a known range, as a ring. The value is written in the middle and read with the name, so the colour only repeats it. For a list of levels use Meter: it takes less room. Docs: https://okaapi.dev/components/gauge-chart ```ts import { GaugeChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - Several levels, or little room: [Meter](https://okaapi.dev/components/meter) - Work that is still going: [Progress](https://okaapi.dev/components/progress) - One number and how it changed: [Stat](https://okaapi.dev/components/stat) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `value` | `number` | | Required. The level now. | | `min` | `number` | `0` | The lowest level. | | `max` | `number` | `100` | The highest level. | | `shape` | `'arc' \| 'half' \| 'ring'` | `'arc'` | Three quarters of a ring, half, or all of it. | | `valueText` | `string` | | The value in words. Defaults to the number. | | `tone` | `'neutral' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | Colour of the fill, when there are no zones. | | `zones` | `GaugeZone[]` | `[]` | Named parts of the scale: from, to, label and tone. | | `target` | `{ value, label }` | | A mark across the ring. | | `ends` | `boolean` | `true` | The lowest and highest value at the ends. | | `formatValue` | `(value: number) => string` | | Writes a value. | | `valueLabel` | `string` | | Names the column of the table. Defaults to Value. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | Keyboard and screen readers: - Tab: Reach the gauge, then its next control. - A named graphic, read in one go. - The same numbers are always there as a real table. - The value and its zone are part of the name, so they are read at once. ### Heatmap Where a number is high or low across two lists, such as days and hours. Five steps of one colour, light to dark, with the number in each cell where there is room. One button shows it as a table. Docs: https://okaapi.dev/components/heatmap-chart ```ts import { HeatmapChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) - One list of amounts: [Bar chart](https://okaapi.dev/components/bar-chart) - A day to choose: [Calendar](https://okaapi.dev/components/calendar) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `x` | `string` | | Required. The row field with the column of a cell. | | `y` | `string` | | Required. The row field with its line. | | `value` | `string` | | Required. The row field with its number. | | `valueLabels` | `boolean` | | Writes the number in each cell. Defaults to on for up to 60 cells. | | `steps` | `number[]` | | Where each step starts, up to five. Defaults to five equal steps. | | `xOrder` | `string[]` | | The order of the columns. Defaults to the order they come in. | | `yOrder` | `string[]` | | The order of the lines. | | `xLabel` | `string` | | Names the bottom axis. | | `yLabel` | `string` | | Names the side axis. | | `formatX` | `(x: string) => string` | | Writes a column. | | `formatY` | `(y: string) => string` | | Writes a line. | | `formatValue` | `(value: number) => string` | | Writes a number. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - The number is written in the cell at 7:1 on its colour, or in the table. ### Histogram How many values fall in each range: delivery times, order sizes, ages. The ranges have round edges, and one button shows them as a table. Docs: https://okaapi.dev/components/histogram-chart ```ts import { HistogramChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - To compare groups: [Box plot](https://okaapi.dev/components/box-chart) - Amounts with names: [Bar chart](https://okaapi.dev/components/bar-chart) - Two numbers that go together: [Scatter chart](https://okaapi.dev/components/scatter-chart) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `value` | `string` | | Required. The row field with the number to count. | | `bins` | `number` | | About how many bars. Defaults to a number that suits the data. | | `median` | `boolean` | `false` | Marks the middle value. | | `references` | `ChartReference[]` | `[]` | Named levels: value and label. | | `xLabel` | `string` | | Names the axis of ranges, and the first table column. | | `yLabel` | `string` | | Names the axis of counts. Defaults to Count in the table. | | `formatValue` | `(value: number) => string` | | Writes a number on the axis of ranges. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Each range and its count are announced together. ### Icons A small set of sharp, adaptable marks. Find one by name or meaning, then shape it to fit. Docs: https://okaapi.dev/foundations/icons ### Input group A text field with fixed text inside its box, before or after the value: a currency, a unit, a domain. The text is read with the field, so 'Price, EGP' is heard, but it is never part of the value. Docs: https://okaapi.dev/components/input-group ```ts import { TextField } from '@okaapi-ui/vue'; ``` When to use something else: - A number with − and + buttons: [Number field](https://okaapi.dev/components/number-field) - A phone number with its country code: [Phone field](https://okaapi.dev/components/phone-field) - A search box with a clear button: [Search field](https://okaapi.dev/components/search-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `prefix` | `string` | | Text before the value, such as "EGP". Read after the label. | | `suffix` | `string` | | Text after the value, such as "kg" or ".com". | | `label` | `string` | | Required. Every other Text field option works too: see Text field. | Keyboard and screen readers: - The text before or after the value is read with the field, such as Price, EGP, but is never part of the value. ### Keyboard key A key to press, on the native kbd element, so screen readers and search engines know it is a key. For a shortcut write one key per element, with the joining + as plain text. Docs: https://okaapi.dev/components/kbd ```ts import { Kbd } from '@okaapi-ui/vue'; ``` When to use something else: - Code or a value the reader types, such as a coupon: A plain code element - A short label for a status: [Badge](https://okaapi.dev/components/badge) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `#default` | `slot` | | The key name. | Keyboard and screen readers: - The native kbd element, so screen readers and search engines know it is a key. ### Language switcher Switches the interface language. Each language is named in itself, so someone who reads only that language can find it, and carries its lang, so screen readers say it in the right voice. No flags: a flag is a country, not a language. Set lang and dir on the html element when the language changes. Docs: https://okaapi.dev/components/language-switcher ```ts import { LanguageSwitcher, type Language } from '@okaapi-ui/vue'; ``` When to use something else: - Any other choice from a list: [Select](https://okaapi.dev/components/select) - Switch between views of a page: [Segmented control](https://okaapi.dev/components/segmented-control) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `languages` | `Language[]` | | Required. { code, name }, each name in its own language. | | `v-model:current` | `string` | | Required. The current language's code. | | `label` | `string` | `'Language' from labels` | Three or more: read before the current name on the button. Translate it. | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | The button's size. | Keyboard and screen readers: - Enter or Space or Down: Open the list of languages. - Up or Down: Move through the languages. - Escape: Close it, and put focus back on the button. - Each language is named in itself and carries its lang, so it is read in the right voice. ### Line chart How values change over time or along a scale. Every line differs by dash as well as colour, the arrow keys walk the values, and one button shows the same numbers as a table. Time runs from right to left in Arabic. Docs: https://okaapi.dev/components/line-chart ```ts import { LineChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - One number and how it changed: [Stat](https://okaapi.dev/components/stat) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) - A level inside a known range: [Meter](https://okaapi.dev/components/meter) - What happened, in order, in words: [Timeline](https://okaapi.dev/components/timeline) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. One row per place along the bottom. | | `x` | `string` | | Required. The row field along the bottom: text, a number or a Date (read in UTC). | | `series` | `LineSeries[]` | | Required. The lines: key, label, and optionally color (1 to 4 or muted), dash and area. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `curve` | `'straight' \| 'smooth' \| 'step'` | `'straight'` | How values are joined. | | `points` | `boolean` | | A dot on every value. Defaults to on for up to 12 rows. | | `connectGaps` | `boolean` | `false` | Joins across missing values. | | `highlight` | `string` | | The key of the line to bring forward; the others turn grey. | | `toggle` | `boolean` | `false` | The names become buttons that switch lines on and off. | | `legend` | `boolean` | | Defaults to on for two lines or more, unless the names are at the line ends. | | `endLabels` | `boolean` | `false` | Writes each name at the end of its line. | | `extremes` | `boolean` | `false` | Marks the highest and the lowest value. | | `references` | `ChartReference[]` | `[]` | Levels to compare with: value and label. | | `bands` | `ChartBand[]` | `[]` | Normal ranges: from, to and label. | | `events` | `ChartEvent[]` | `[]` | What happened and where: x and label. | | `range` | `ChartRange` | | The range around the first line: low and high fields, and a label. | | `forecastFrom` | `string \| number \| Date` | | The last real place; after it the lines are dotted. | | `xLabel` | `string` | | Names the bottom axis, and the first table column. | | `yLabel` | `string` | | Names the side axis. | | `yMin` | `number` | | Where the side axis starts. Defaults to fit the values. | | `yMax` | `number` | | Where the side axis ends. | | `formatX` | `(x) => string` | | Writes a place along the bottom. | | `formatY` | `(y: number) => string` | | Writes a value, in the axis, the tooltip and the table. | | `sparkline` | `boolean` | `false` | A small line with no axes. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the lines that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Lines differ by dash as well as colour, and text is never drawn in a line colour. ### Menu A short list of actions that opens from a button, such as the actions on a row. Enter, Space or the down arrow open it, the arrow keys and typing move through it, and Escape closes it and puts focus back on the button. For choosing a value, use a select. Docs: https://okaapi.dev/components/menu ```ts import { Menu } from '@okaapi-ui/vue'; ``` When to use something else: - The same actions on right-click or a long press: [Context menu](https://okaapi.dev/components/context-menu) - Pick a value that a form sends: [Select](https://okaapi.dev/components/select) - Links that go to other pages: [Navigation](https://okaapi.dev/components/nav) - Two or three actions that fit on screen: [Button group](https://okaapi.dev/components/button-group) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | The button's text. | | `#label` | `slot` | | In place of label: an icon, a count. | | `aria-label` | `string` | | The button's name, when its content is an icon. | | `items` | `MenuAction[]` | | Required. { id, label, danger?, disabled? }. | | `@action` | `event` | | Required. Called with the chosen action's id. | | `variant` | `ButtonVariant` | `'secondary'` | The button's look. | Keyboard and screen readers: - Enter or Space or Down: Open the menu from its button. - Up or Down: Move through the actions. - Letters: Jump to the action that starts with them. - Enter or Space: Run the action. - Escape: Close it, and put focus back on the button. - Read as a menu of items; the button says it opens a menu. ### Meter A level inside a known range: storage used, a plan's limit, a score. It is not work in progress, that is Progress. The value is written next to the label, so the tone colour only repeats what the words say. Docs: https://okaapi.dev/components/meter ```ts import { Meter } from '@okaapi-ui/vue'; ``` When to use something else: - Work that is still going, such as an upload: [Progress](https://okaapi.dev/components/progress) - One number and how it changed: [Stat](https://okaapi.dev/components/stat) - A value the reader sets: [Slider](https://okaapi.dev/components/slider) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. What is measured. | | `value` | `number` | | Required. The level now, between min and max. | | `min` | `number` | `0` | The lowest level. | | `max` | `number` | `100` | The highest level. | | `valueText` | `string` | | The value in words, shown and read: "7.2 of 10 GB". Defaults to a percentage. | | `tone` | `'neutral' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | Colour of the fill. You decide it from the value. | Keyboard and screen readers: - The native meter, named by its label, with the value in words beside it. ### Navigation The app's main links, in a side bar. A named navigation landmark, links at least 44px tall, and the current page marked with a bar and bold text, not only a fill. On a phone, put the same links in a drawer. Docs: https://okaapi.dev/components/nav ```ts import { Nav } from '@okaapi-ui/vue'; ``` When to use something else: - A whole app layout with header and side bar: [App shell](https://okaapi.dev/components/app-shell) - Views of one page: [Tabs](https://okaapi.dev/components/tabs) - Where the page sits in the site: [Breadcrumbs](https://okaapi.dev/components/breadcrumbs) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the landmark. | Keyboard and screen readers: - A named navigation landmark; the current page is marked for screen readers and with a bar and bold text. ### Number field A number with − and + either side. Type it, in Latin or Arabic digits, or step it with the buttons, the arrow keys, or Page Up and Down for ten steps. On leaving the field it stays inside its limits and is written in the reader's language. Docs: https://okaapi.dev/components/number-field ```ts import { NumberField } from '@okaapi-ui/vue'; ``` When to use something else: - A rough amount on a scale: [Slider](https://okaapi.dev/components/slider) - A code such as an ID or a card number: [Text field](https://okaapi.dev/components/text-field) - A price with a currency beside it: [Input group](https://okaapi.dev/components/input-group) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Names the field. | | `min \| max` | `number` | | Limits. Stepping stops at them; typing is pulled back on leaving. | | `step` | `number` | `1` | One press. Page Up and Down move ten. | | `formatOptions` | `Intl.NumberFormatOptions` | | Currency, units or decimals. With percent the value is the fraction, so step 0.01. | | `hint \| error` | `string` | | Help text, and the translated error that marks it invalid. | | `decrementLabel \| incrementLabel` | `string` | `Decrease \| Increase` | Names the buttons. Translate them. | | `v-model` | `number \| null` | | The number, or null when the field is empty. | Keyboard and screen readers: - Up or Down: Step up or down by one step. - Page Up or Page Down: Step by ten steps. - Home or End: Go to the lowest or highest value, when there is one. - Enter: Keep the value inside its limits and write it out. - Latin and Arabic digits are both taken; the − and + buttons are named. ### Pagination Moves through long lists a page at a time. A named navigation landmark: each page button says its number, the current page is marked, and the line of shown rows is announced when it changes. Docs: https://okaapi.dev/components/pagination ```ts import { Pagination } from '@okaapi-ui/vue'; ``` When to use something else: - Steps of a task: [Stepper](https://okaapi.dev/components/stepper) - Where the page sits in the site: [Breadcrumbs](https://okaapi.dev/components/breadcrumbs) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `v-model:page` | `number` | | Required. The current page, from 1. | | `total` | `number` | | Required. Rows across all pages. | | `v-model:pageSize` | `number` | `10` | Rows per page; a new size also goes back to page 1. | | `pageSizes` | `number[]` | `[]` | Offer these sizes in a picker. Empty: no picker. | | `labels` | `Partial` | | Translated texts: nav, previous, next, page(n), summary(first, last, total), pageSize. | Keyboard and screen readers: - Tab: Move between the page buttons. - A named navigation landmark; each button says its page number, and the current page is marked. - The line of shown rows is announced when it changes. ### Phone field A phone number with its country code. The number reads left to right in every language, Arabic digits are welcome, and the 0 people type before a mobile number out of habit is dropped. What the form gets is one international number, ready to send a text to. Docs: https://okaapi.dev/components/phone-field ```ts import { PhoneField, PHONE_COUNTRIES } from '@okaapi-ui/vue'; // Bind one E.164 number with v-model, or null when empty. ``` When to use something else: - Any other number: [Number field](https://okaapi.dev/components/number-field) - A one-time code sent by SMS: [PIN input](https://okaapi.dev/components/pin-input) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Names the number. | | `country` | `string` | `EG` | The country picked at first, by ISO code. A stored number picks its own. | | `countries` | `PhoneCountry[]` | `PHONE_COUNTRIES` | { code, dial, name }. ISO alpha-2 code supplies a flag, drawn the same on every system. The Arab world first, then the most common elsewhere. | | `countryLabel` | `string` | `Country code from labels` | Names the list for screen readers. Translate it. | | `hint \| error \| placeholder` | `string` | | Help text, the translated error, an example. | | `v-model` | `string \| null` | | The number as E.164, or null. | | `name` | `string` | | Submits the whole number with a form. | Keyboard and screen readers: - Up or Down: On the country button, open the list of countries. - Up or Down or Home or End: In the list, move through the countries. - Enter or Space: Pick the country. - Escape or Tab: Close the list. - The country button is read with the country and its code; the number reads left to right in every language. ### Pie chart Parts of one whole, at one moment. Up to five slices: people judge angles badly, so the rest join into one. Every slice has a texture and its share in words, and one button shows every number as a table. Docs: https://okaapi.dev/components/pie-chart ```ts import { PieChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - More than five parts, or a close comparison: [Bar chart](https://okaapi.dev/components/bar-chart) - How the mix changes over time: [Area chart](https://okaapi.dev/components/area-chart) - One level inside a known range: [Meter](https://okaapi.dev/components/meter) - One number and how it changed: [Stat](https://okaapi.dev/components/stat) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `name` | `string` | | Required. The row field with the slice's name. | | `value` | `string` | | Required. The row field with its number, zero or more. | | `donut` | `boolean` | `false` | A hole in the middle. | | `half` | `boolean` | `false` | Half a ring. | | `labels` | `boolean` | `false` | Names and shares around it, where there is room. | | `center` | `string` | | Text in the middle of a donut. | | `centerText` | `string` | | A second, quieter line under it. | | `highlight` | `string` | | The name of the slice to bring forward; the others turn grey. | | `sort` | `'value' \| 'none'` | `'value'` | Biggest first, or the order of the rows. | | `maxSlices` | `number` | `5` | How many slices before the rest join into one. | | `otherLabel` | `string` | | The name of the slice that joins the rest. Defaults to Other. | | `formatValue` | `(value: number) => string` | | Writes a value, in the tooltip and the table. | | `nameLabel` | `string` | | Names the first column of the table. | | `valueLabel` | `string` | | Names the second. Defaults to Value. | | `shareLabel` | `string` | | Names the third. Defaults to Share. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `toggle` | `boolean` | `false` | The names become buttons that switch parts on and off. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `patterns` | `boolean` | `true` | Textures over the colours, so shapes differ without colour. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Slices differ by texture as well as colour, and the legend writes the share of each. ### PIN input A code sent by text message, one box per digit. Typing moves along, Backspace goes back, and pasting the code fills every box. On a phone the keyboard offers the code from the message, and the boxes take it all at once. Docs: https://okaapi.dev/components/pin-input ```ts import { PinInput } from '@okaapi-ui/vue'; ``` When to use something else: - A password: [Text field with type password](https://okaapi.dev/components/text-field) - A phone number: [Phone field](https://okaapi.dev/components/phone-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Names the boxes as a group. | | `length` | `number` | `6` | How many digits. | | `secret` | `boolean` | `false` | Dots instead of digits, for a PIN. | | `cellLabel` | `(n, of) => string` | ``Digit ${n} of ${of}` from labels` | Each box's name for screen readers. Translate it. | | `hint \| error` | `string` | | Help text, and the translated error that marks it invalid. | | `v-model` | `string` | | The code typed so far. | | `@complete` | `event` | | Fires with the code once every box is filled. | | `name` | `string` | | Adds a hidden input with the whole code, for forms. | Keyboard and screen readers: - A digit: Fill the box and move to the next one. - Backspace: In an empty box, go back to the one before. - Left or Right: Move to the box before or after. - Home or End: Go to the first or last box. - Pasting the code fills every box, and phones offer the code from the message. ### Popover A small panel next to its button, for a few details or a couple of settings. It is not modal: focus moves into it, and Escape or a click outside closes it and puts focus back on the button. Screen readers name it after the button. For a task that needs the reader's full attention, use a dialog. Docs: https://okaapi.dev/components/popover ```ts import { Popover } from '@okaapi-ui/vue'; ``` When to use something else: - A short label for an icon button: [Tooltip](https://okaapi.dev/components/tooltip) - A list of actions: [Menu](https://okaapi.dev/components/menu) - A task that needs the reader’s full attention: [Dialog](https://okaapi.dev/components/dialog) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `#trigger` | `slot` | | Required. One pressable element, such as Button. | | `default slot` | `slot` | | The content of the panel. | | `placement` | `'bottom start' \| 'top start' \| …` | `'bottom start'` | Where it opens, if there is room. | Keyboard and screen readers: - Enter or Space: Open it from its button; focus moves in. - Escape: Close it, and put focus back on the button. - Named after its button. It is not modal, so the page stays reachable. ### Progress How far a long task has got, such as an upload. The native progress bar, named by its label, with the amount in words beside it. Without a value it shows a moving band: work is going on but its length is not known. Docs: https://okaapi.dev/components/progress ```ts import { Progress } from '@okaapi-ui/vue'; ``` When to use something else: - A level that is not work being done, such as storage used: [Meter](https://okaapi.dev/components/meter) - Waiting with no idea how long: [Spinner](https://okaapi.dev/components/spinner) - Steps the reader goes through: [Stepper](https://okaapi.dev/components/stepper) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the bar. | | `value` | `number \| null` | | How much is done. Leave it out when unknown. | | `max` | `number` | `100` | The value when done. | | `valueText` | `string` | | The amount in words; defaults to a percentage. | Keyboard and screen readers: - The native progress bar, named by its label, with the amount in words beside it. - Without a value it shows a moving band: work is going on but its length is not known. ### Property list Label and value pairs, such as the details of one order. Built on the native description list, so screen readers say how many items there are and pair each label with its value. Docs: https://okaapi.dev/components/property-list ```ts import { Property, PropertyList } from '@okaapi-ui/vue'; ``` When to use something else: - Many records with the same fields: [Data table](https://okaapi.dev/components/data-table) - One headline number: [Stat](https://okaapi.dev/components/stat) - Values the reader edits: [Text field and the other form fields](https://okaapi.dev/components/text-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `layout` | `'columns' \| 'stacked'` | `'columns'` | On PropertyList. Stacked puts each label above its value at any width. | | `term` | `string` | | On Property, required: the label. Its slot is the value. | Keyboard and screen readers: - The native description list, so each label is paired with its value. ### Radar chart Several measures of one thing, or of two or three, around a circle. For the shape, not for exact values: bars compare better. Lines differ by dash as well as colour, and one button shows the numbers as a table. Docs: https://okaapi.dev/components/radar-chart ```ts import { RadarChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - To compare the values exactly: [Bar chart](https://okaapi.dev/components/bar-chart) - How two numbers go together: [Scatter chart](https://okaapi.dev/components/scatter-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `x` | `string` | | Required. The row field with the measure. | | `series` | `ChartSeries[]` | | Required. The shapes: key, label, and optionally color. | | `max` | `number` | | The value at the rim. Defaults to the highest, rounded up. | | `levels` | `number` | `4` | How many rings. | | `filled` | `boolean` | `true` | A soft fill inside each shape. | | `highlight` | `string` | | The key of the shape to bring forward; the others turn grey. | | `xLabel` | `string` | | Names the first column of the table. | | `formatX` | `(x) => string` | | Writes a measure. | | `formatY` | `(y: number) => string` | | Writes a value. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `toggle` | `boolean` | `false` | The names become buttons that switch parts on and off. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Shapes differ by the dash of their line as well as colour. ### Radio group One choice from a short list, with every option in view. Native radios: Tab reaches the group, arrow keys move the choice. For more than five or six options, use a select. Docs: https://okaapi.dev/components/radio-group ```ts import { RadioGroup } from '@okaapi-ui/vue'; ``` When to use something else: - Several choices at once: [Checkbox](https://okaapi.dev/components/checkbox) - More than about 7 options: [Select](https://okaapi.dev/components/select) - Switch the view of the page: [Segmented control](https://okaapi.dev/components/segmented-control) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the group. | | `options` | `RadioOption[]` | | Required. { value, label, disabled? } for each radio. | | `v-model` | `string` | | The chosen value. | | `@change` | `event` | | The native change event; v-model already holds the new choice. | | `orientation` | `'vertical' \| 'horizontal'` | `'vertical'` | Side by side for two or three short answers. | | `hint, error` | `string` | | As for the text field. | | `disabled` | `boolean` | | Disables every radio. | | `name` | `string` | | Form field name; made up when left out. | | `testId` | `string` | | data-testid prefix; each radio gets -. | Keyboard and screen readers: - Tab: Reach the group, on the chosen option. - Arrow keys: Move the choice to the next or previous option. - Native radios in a named group, so the group name is read first. ### Rating Stars out of five, to pick a score or to show one. Picking uses real radio buttons, so Tab reaches the stars, arrow keys move between them and a screen reader says 3 stars, 3 of 5. Filled stars are solid and empty ones an outline, so the shape tells them apart, not only colour. Docs: https://okaapi.dev/components/rating ```ts import { Rating } from '@okaapi-ui/vue'; ``` When to use something else: - An exact number: [Number field](https://okaapi.dev/components/number-field) - Show a score the reader cannot change: [Meter](https://okaapi.dev/components/meter) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Names the stars, as the fieldset legend. Required when people pick. | | `max` | `number` | `5` | How many stars. | | `starLabel` | `(stars: number) => string` | ``${n} stars` from labels` | The name of one star, read by screen readers. Translate it. | | `scoreLabel` | `(value, max) => string` | ``${v} out of ${m} stars` from labels` | The read-only score in words. Translate it. | | `readOnly` | `boolean` | `false` | Shows a score as stars, for reading only. | | `v-model` | `number \| null` | | The score. | | `name \| disabled` | `string \| boolean` | | For the radios underneath. | | `@blur` | `event` | | When focus leaves a star. | Keyboard and screen readers: - Tab: Reach the group, on the chosen option. - Arrow keys: Move the choice to the next or previous option. - Real radio buttons, read as 3 stars, 3 of 5. - Filled stars are solid and empty ones an outline, so shape tells them apart. ### Scatter chart Two numbers for each thing, to see whether they go together. A third number makes bubbles. Groups differ by shape as well as colour, and one button shows the same numbers as a table. Docs: https://okaapi.dev/components/scatter-chart ```ts import { ScatterChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - How one number changes over time: [Line chart](https://okaapi.dev/components/line-chart) - Amounts to compare: [Bar chart](https://okaapi.dev/components/bar-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `x` | `string` | | Required. The row field with the number along the bottom. | | `y` | `string` | | Required. The row field with the number up the side. | | `size` | `string` | | The row field with a third number: the area of the bubble. | | `group` | `string` | | The row field that sorts points into groups, up to four. | | `name` | `string` | | The row field with the name of a point, in the tooltip and the table. | | `nameLabels` | `boolean` | `false` | Writes the name at each point. | | `trend` | `boolean` | `false` | The straight line that fits best. | | `highlight` | `string` | | The group to bring forward; the others turn grey. | | `xReferences` | `ChartReference[]` | `[]` | Named levels along the bottom. | | `yReferences` | `ChartReference[]` | `[]` | Named levels up the side. | | `xLabel` | `string` | | Names the bottom axis, and its column in the table. | | `yLabel` | `string` | | Names the side axis, and its column. | | `sizeLabel` | `string` | | Names the size, in the tooltip and the table. | | `nameLabel` | `string` | | Names the column of names. | | `groupLabel` | `string` | | Names the column of groups. | | `xMin` | `number` | | Where the bottom axis starts. Defaults to fit the points. | | `xMax` | `number` | | Where it ends. | | `yMin` | `number` | | Where the side axis starts. Defaults to fit the points. | | `yMax` | `number` | | Where it ends. | | `formatX` | `(x: number) => string` | | Writes the number along the bottom. | | `formatY` | `(y: number) => string` | | Writes the number up the side. | | `formatSize` | `(size: number) => string` | | Writes the size. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `toggle` | `boolean` | `false` | The names become buttons that switch parts on and off. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Groups differ by shape as well as colour, and the trend line is dashed. ### Search field A box to search with: a magnifier, the text, and a × to clear it. Escape clears it too, and Enter searches. A real search input, so phones show a Search key and screen readers say search. Docs: https://okaapi.dev/components/search-field ```ts import { SearchField } from '@okaapi-ui/vue'; ``` When to use something else: - Search the whole app and run commands: [Command palette](https://okaapi.dev/components/command-palette) - Pick one value from a list as you type: [Combobox](https://okaapi.dev/components/combobox) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Names the field. | | `hideLabel` | `boolean` | `false` | Keeps the label for screen readers only. | | `placeholder \| hint` | `string` | | An example inside the box; help text under it. | | `clearLabel` | `string` | `Clear search from labels` | Names the × button. Translate it. | | `v-model` | `string` | | The text typed so far. | | `@search` | `event` | | Enter was pressed; gets the text. | | `disabled \| name` | `boolean \| string` | | As on any input. | Keyboard and screen readers: - Enter: Search. - Escape: Clear the text. - A real search input, read as search; the clear button is named. ### Segmented control One choice from two to five short options, side by side: a view, a period, a size. Radio buttons underneath, so Tab reaches the group and the arrow keys move the choice. The chosen one is lifted onto a tile with an edge, not just coloured. Docs: https://okaapi.dev/components/segmented-control ```ts import { SegmentedControl } from '@okaapi-ui/vue'; ``` When to use something else: - Show different panels of content: [Tabs](https://okaapi.dev/components/tabs) - A choice sent with a form: [Radio group](https://okaapi.dev/components/radio-group) - One option that is on or off: [Toggle](https://okaapi.dev/components/toggle) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Names the group for screen readers. | | `options` | `{ value, label, icon?, disabled? }[]` | | Two to five short options. | | `iconOnly` | `boolean` | `false` | Shows only the icons; the words are still read. | | `block` | `boolean` | `false` | Fills the width, segments sharing it. | | `v-model` | `string` | | The picked value. | | `disabled \| name` | `boolean \| string` | | For the radios underneath. | Keyboard and screen readers: - Tab: Reach the group, on the chosen option. - Arrow keys: Move the choice to the next or previous option. - Radio buttons underneath; the chosen option is lifted onto a tile with an edge, not only coloured. ### Select One choice from a list. Arrow keys, Home and End, and typing the first letters all move through the options; Escape and Tab close the list and return focus. Docs: https://okaapi.dev/components/select ```ts import { Select, type SelectOption } from '@okaapi-ui/vue'; ``` When to use something else: - A long list the reader searches: [Combobox](https://okaapi.dev/components/combobox) - Two to five options that fit on screen: [Radio group](https://okaapi.dev/components/radio-group) - Actions, not values: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. The visible label; it names the button and the list. | | `options` | `SelectOption[]` | | Required. { value, label, disabled? } for each option; value is a string or number. | | `v-model` | `T \| null` | | The chosen value, controlled or not. | | `placeholder` | `string` | `''` | Shown while nothing is chosen. | | `error` | `string` | | The translated error. Marks the field invalid and announces the message. | | `disabled` | `boolean` | `false` | Disables the select. | | `name` | `string` | | Field name, so the value is sent with a native form. | | `testId` | `string` | | data-testid on the button; options get -option-. | Keyboard and screen readers: - Enter or Space or Up or Down: Open the list. - Up or Down or Home or End: Move through the options. - Letters: Jump to the option that starts with them. - Enter or Space: Pick the option. - Escape or Tab: Close the list, and put focus back on the button. - Read as a list box, with the chosen option and the field’s label. ### Skeleton Grey shapes where content is loading, so the page does not jump when it arrives. Screen readers skip the shapes: mark the area busy and say it is loading with a spinner or a status message. With reduced motion the shapes stop pulsing. Docs: https://okaapi.dev/components/skeleton ```ts import { Skeleton } from '@okaapi-ui/vue'; ``` When to use something else: - Work with a known length: [Progress](https://okaapi.dev/components/progress) - A short wait inside a button: [Spinner](https://okaapi.dev/components/spinner) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `shape` | `'text' \| 'circle' \| 'block'` | `'text'` | Lines, an avatar, or an image or card. | | `lines` | `number` | `1` | Lines of text; the last one is shorter. | Keyboard and screen readers: - Screen readers skip the shapes: mark the area busy and say it is loading in words. - With reduced motion the shapes stop pulsing. ### Slider A value picked along a range, such as a price limit or a volume. It is the browser's own range input, so arrow keys, Page Up and Down, Home and End all move it, and the value is written beside the label. For an exact number, use a number field. Docs: https://okaapi.dev/components/slider ```ts import { Slider } from '@okaapi-ui/vue'; // Every other attribute goes to the input: name, disabled. ``` When to use something else: - An exact value: [Number field](https://okaapi.dev/components/number-field) - Show a level the reader cannot change: [Meter](https://okaapi.dev/components/meter) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the slider. | | `min \| max` | `number` | `0 \| 100` | The ends of the range. | | `step` | `number` | `1` | How far one arrow key press moves it. | | `format` | `(value: number) => string` | | The value as shown and as read aloud, with its unit. | | `hint` | `string` | | Help under the slider, read after the label. | | `v-model` | `number` | | The value. Starts at min without a binding. | Keyboard and screen readers: - Left or Right or Up or Down: Move by one step. - Page Up or Page Down: Move by a bigger step. - Home or End: Go to the lowest or highest value. - The browser’s own range input, named by its label; the value is also written beside it. ### Spinner Shows that something is loading and says what, in words, to screen readers. Keep it for waits of more than a second. With reduced motion it stops turning and stays as a faint ring. Docs: https://okaapi.dev/components/spinner ```ts import { Spinner } from '@okaapi-ui/vue'; ``` When to use something else: - Work with a known length: [Progress](https://okaapi.dev/components/progress) - A whole page or card that is loading: [Skeleton](https://okaapi.dev/components/skeleton) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | `'Loading' from labels` | What is loading, translated. | | `showLabel` | `boolean` | `false` | Shows the label next to it too. | | `size` | `'md' \| 'lg'` | `'md'` | lg: a big spinner over its label. | Keyboard and screen readers: - Says what is loading, in words, to screen readers. - With reduced motion it stops turning and stays as a faint ring. ### Stat One number with its label, and how it changed. The change is written out, with its sign or in words; the arrow and the colour only repeat it. Docs: https://okaapi.dev/components/stat ```ts import { Stat } from '@okaapi-ui/vue'; ``` When to use something else: - A level against a limit, such as 70% of storage: [Meter](https://okaapi.dev/components/meter) - Several label and value pairs: [Property list](https://okaapi.dev/components/property-list) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. What the number counts. | | `value` | `string` | | Required. The number, already formatted with its unit. | | `change` | `string` | | How it changed, readable on its own: "+12% on last month". | | `trend` | `'up' \| 'down' \| 'flat'` | | The arrow beside the change. | | `tone` | `'positive' \| 'negative' \| 'neutral'` | `'neutral'` | Green, red or grey for the change. Set it by meaning, not by direction. | Keyboard and screen readers: - The change is written out, with its sign or in words; the arrow and colour only repeat it. ### Status dot A small coloured dot before the word for a live state: online, busy, offline. The word is always there and carries the meaning; the dot lets the eye scan a long list. Docs: https://okaapi.dev/components/status-dot ```ts import { StatusDot } from '@okaapi-ui/vue'; ``` When to use something else: - A status that stands out in a table row, such as Paid: [Badge](https://okaapi.dev/components/badge) - A message about the status: [Alert](https://okaapi.dev/components/alert) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `tone` | `'neutral' \| 'info' \| 'success' \| 'warning' \| 'danger'` | `'neutral'` | Colour of the dot. The words still say the status. | | `#default` | `slot` | | The word for the status. | Keyboard and screen readers: - The word is always there and carries the meaning; the dot is not read. ### Stepper A flow split into steps, such as checkout. Each step holds its own content, and the stepper shows the current one with Back and Next under it. The step names are buttons, so people can go back. Done steps have a tick and are read as Done, the current one is announced as the current step, and focus moves to the new step's content after each change. Docs: https://okaapi.dev/components/stepper ```ts import { Stepper } from '@okaapi-ui/vue'; ``` When to use something else: - Views the reader can open in any order: [Tabs](https://okaapi.dev/components/tabs) - Pages of a list: [Pagination](https://okaapi.dev/components/pagination) - What happened to a request, in time order: [Timeline](https://okaapi.dev/components/timeline) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the list of steps: "Checkout". | | `linear` | `boolean` | `false` | Each step waits for the ones before it to be completed, and Next waits for the current one. | | `doneLabel` | `string` | `'Done' from labels` | Read before each done step. Translate it. | | `backLabel \| nextLabel \| finishLabel` | `string` | `'Back' \| 'Next' \| 'Finish' from labels` | The button labels. Translate them. | | `number` | `(n: number) => string` | `String` | The marker's number, for Arabic digits. | | `steps` | `{ label, completed? }[]` | | Required. completed defaults to true; false keeps a linear stepper on it. | | `v-model` | `number` | `0` | Index of the current step. | | `#panel` | `slot` | | Renders each step from { index, step }. Hidden steps stay mounted, so what was typed is kept. | | `@blocked` | `event` | | Linear only: Next or Finish was pressed on a step that is not completed. | | `@finish` | `event` | | Finish was pressed on the last step. | Keyboard and screen readers: - Tab: Reach the step names, Back and Next. - Done steps are read as Done and the current one as the current step. - Focus moves to the new step’s content after each change. ### Switch An on or off setting that takes effect at once, with no save button. Screen readers say on and off, and the knob's side shows the state, so it never depends on colour. For a choice saved with a form, use a checkbox. Docs: https://okaapi.dev/components/switch ```ts import { Switch } from '@okaapi-ui/vue'; // Bind it with v-model; every other attribute goes to the input: name, required. ``` When to use something else: - A choice sent with a form: [Checkbox](https://okaapi.dev/components/checkbox) - A pressed state in a toolbar, such as bold: [Toggle](https://okaapi.dev/components/toggle) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. The setting it turns on. | | `hint` | `string` | | Help text under it, read with the switch. | | `testId` | `string` | | data-testid on the input. | Keyboard and screen readers: - Space: Turn it on or off. - A checkbox with the switch role, so screen readers say on and off. ### Tabs Views of one thing side by side, such as an order's details and its history. Tab reaches the chosen tab, the arrow keys move between tabs and show each one, Home and End go to the first and last. The chosen tab gets a bar and full-strength text, not only a colour. Docs: https://okaapi.dev/components/tabs ```ts import { TabNav, Tabs } from '@okaapi-ui/vue'; // Arrow keys follow dir on . ``` When to use something else: - Links to other pages: [Navigation](https://okaapi.dev/components/nav) - Change how the same content is shown: [Segmented control](https://okaapi.dev/components/segmented-control) - Sections the reader may open together: [Accordion](https://okaapi.dev/components/accordion) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the tab list. | | `tabs` | `TabItem[]` | | Required. { id, label, disabled?, keep? }. Each panel is the slot named after its id; it mounts only while its tab is chosen, and keep holds it once shown. | | `v-model:selected` | `string` | | The chosen tab's id. | | `TabNav label` | `string` | | Required. Names the navigation; put links with class="ui-tab" inside, the current one aria-current="page". | Keyboard and screen readers: - Tab: Reach the chosen tab, and Tab again moves into its panel. - Left or Right: Move to the previous or next tab and show it. Flipped in Arabic. - Home or End: Go to the first or last tab. - Read as tabs, with how many there are and which is chosen. ### Tag A label the user added or can take away, such as an active filter or a topic. For a status like Paid or Late, use a badge. Docs: https://okaapi.dev/components/tag ```ts import { Tag } from '@okaapi-ui/vue'; ``` When to use something else: - A status the user cannot remove: [Badge](https://okaapi.dev/components/badge) - Let the user type new labels: [Chip input](https://okaapi.dev/components/chip-input) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `@remove` | `event` | | Shows the × button and is called when it is pressed. Remove the tag and move focus on. | | `removeLabel` | `string` | `'Remove' from labels` | The button's first word; the tag's text follows it. Translate it. | Keyboard and screen readers: - Enter or Space: On the remove button, take the tag away. - The remove button is named after the tag, such as Remove Angular. ### Text field Label, input, hint and error as one control. The label, hint and error are tied to the input, so screen readers read all three. Docs: https://okaapi.dev/components/text-field ```ts import { TextField } from '@okaapi-ui/vue'; // Bind it with v-model; every other attribute goes to the input: // name, autocomplete, required, maxlength. ``` When to use something else: - Several lines of text: [Textarea](https://okaapi.dev/components/textarea) - A unit or currency beside the value: [Input group](https://okaapi.dev/components/input-group) - A number with − and + buttons: [Number field](https://okaapi.dev/components/number-field) - Search with a clear button: [Search field](https://okaapi.dev/components/search-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. The visible label, tied to the input. | | `type` | `'text' \| 'email' \| 'password' \| 'search' \| 'tel' \| 'url'` | `'text'` | The input type. | | `hint` | `string` | | Help text under the input, read with it. | | `error` | `string` | | The translated error. Marks the input invalid and announces the message. | | `testId` | `string` | | data-testid on the input, for tests. | Keyboard and screen readers: - The label, hint and error are tied to the input, so all three are read. - An error is announced when it appears. ### Textarea The multi-line twin of the text field: the same label, hint and error, with room for a few lines. The reader can make it taller. Docs: https://okaapi.dev/components/textarea ```ts import { Textarea } from '@okaapi-ui/vue'; // Bind it with v-model; every other attribute goes to the textarea: rows, maxlength. ``` When to use something else: - One line of text: [Text field](https://okaapi.dev/components/text-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. The visible label, tied to the textarea. | | `hint` | `string` | | Help text under the textarea, read with it. | | `error` | `string` | | The translated error. Marks the textarea invalid and announces the message. | | `testId` | `string` | | data-testid on the textarea, for tests. | Keyboard and screen readers: - The same label, hint and error as the text field, all read with it. ### Timeline A chronological record of decisions and updates. Each event can show who acted, when it happened, and the outcome, so a case's approval history is easy to scan. Docs: https://okaapi.dev/components/timeline ```ts import { Timeline } from '@okaapi-ui/vue'; ``` When to use something else: - Steps still to do: [Stepper](https://okaapi.dev/components/stepper) - Many records to sort and filter: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the ordered history list. | | `items` | `TimelineItem[]` | | Required. Events in chronological order. | | `TimelineItem` | `{ title, date, dateTime?, actor?, description?, status?, statusLabel? }` | | Event details. dateTime is a machine-readable value for the semantic time element. | | `TimelineItem.status` | `'approved' \| 'pending' \| 'rejected'` | | Adds a status icon and tone label to the event. | | `TimelineItem.statusLabel` | `string` | | Overrides the default status text, including for translation. | Keyboard and screen readers: - An ordered list, so screen readers say how many events there are; each date is a time element. ### Toast A short note after an action, such as Saved, at the bottom end of the screen. Screen readers hear it as it comes. It closes by itself after 6 seconds, but never while the pointer or focus is on it, and never when it holds an action, so nobody loses the Undo to a timer. Docs: https://okaapi.dev/components/toast ```ts import { ToastProvider, useToast } from '@okaapi-ui/vue'; ``` When to use something else: - A message that must stay until it is fixed: [Alert](https://okaapi.dev/components/alert) - A decision the reader must make now: [Alert dialog](https://okaapi.dev/components/alert-dialog) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `` | `component` | | Once, around the app. label names the region; closeLabel names each × button. | | `useToast().show(message, options?)` | `number` | | Shows a toast and returns its id. options: tone, title, duration (ms, 0 keeps it), action { label, run }. | | `useToast().dismiss(id)` | `void` | | Removes a toast early. | Keyboard and screen readers: - Tab: Reach the action or the close button inside a toast. - Toasts sit in a named live region, so each one is read as it comes. - The timer waits while the pointer or focus is on a toast, and never runs on one with an action. ### Toggle A button that stays pressed until it is pressed again. The label stays the same; screen readers hear 'pressed' or 'not pressed', and the look changes in fill and border, not colour alone. Docs: https://okaapi.dev/components/toggle ```ts import { Toggle } from '@okaapi-ui/vue'; ``` When to use something else: - A setting that takes effect at once, such as notifications: [Switch](https://okaapi.dev/components/switch) - One of several views, such as grid or list: [Segmented control](https://okaapi.dev/components/segmented-control) - An action that happens once, such as Save: [Button](https://okaapi.dev/components/button) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `v-model:pressed` | `boolean` | | Pressed or not. Without it the toggle keeps its own state. | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Height and text size, as on Button. | | `iconOnly` | `boolean` | `false` | Square, for an icon alone. Give it an aria-label. | | `disabled` | `boolean` | `false` | Cannot be pressed. | Keyboard and screen readers: - Enter or Space: Press it, or let it go. - Read as a toggle button, pressed or not pressed; the label never changes. ### Toolbar A row of controls that counts as one stop for the Tab key. Inside it the arrow keys move from control to control, flipped in Arabic; Home and End jump to the ends. Tab again leaves it. Docs: https://okaapi.dev/components/toolbar ```ts import { Toolbar, ToolbarSeparator } from '@okaapi-ui/vue'; ``` When to use something else: - Two or three buttons that sit together: [Button group](https://okaapi.dev/components/button-group) - Links to other pages: [Navigation](https://okaapi.dev/components/nav) - Actions that do not fit, behind one button: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. What the controls act on, for screen readers. | | `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Which arrow keys move: left and right, or up and down. | | `` | `component` | | A line between groups of controls. | Keyboard and screen readers: - Tab: Enter the toolbar, and Tab again leaves it. - Left or Right: Move to the previous or next control, wrapping round. Flipped in Arabic. - Up or Down: The same, in a vertical toolbar. - Home or End: Go to the first or last control. - Read as a toolbar with its name and orientation. ### Tooltip A short label for a control, shown on hover and on keyboard focus and read by screen readers as its description. The pointer can move onto it and Escape hides it. Touch screens never show tooltips, so never put anything needed in one. Docs: https://okaapi.dev/components/tooltip ```ts import { Tooltip } from '@okaapi-ui/vue'; ``` When to use something else: - Content with links or buttons: [Popover](https://okaapi.dev/components/popover) - Help the reader needs to fill a field: [The field’s hint](https://okaapi.dev/components/text-field) - Show a keyboard shortcut: [Keyboard key inside the tooltip](https://okaapi.dev/components/kbd) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `text` | `string` | | Required. The short label. | | `default slot` | `slot` | | One focusable element, such as Button. | | `placement` | `'top' \| 'bottom' \| 'start' \| 'end'` | `'top'` | Where it shows, if there is room. | Keyboard and screen readers: - Tab: Focus the control, and its tooltip shows. - Escape: Hide the tooltip. - Read as the control’s description; the pointer can move onto it. - Touch screens never show tooltips, so nothing needed may live only in one. ### Tree Nested items that open and close, such as folders or menu categories. One Tab stop: the arrow keys move, Right opens a branch and Left closes it, typing a name jumps to it, and Enter or Space selects. For a site's page links, use navigation instead. Docs: https://okaapi.dev/components/tree ```ts import { Tree, type TreeNode } from '@okaapi-ui/vue'; // On the Reka UI tree. ``` When to use something else: - A flat list with columns: [Data table](https://okaapi.dev/components/data-table) - Sections that open and close: [Accordion](https://okaapi.dev/components/accordion) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the tree: "Menu", "Files". | | `nodes` | `TreeNode[]` | | Required. { id, label, children? }, nested as deep as needed. | | `defaultExpanded` | `string[]` | | Ids of the branches open at first. | | `v-model:selected` | `string` | | The selected node's id. | Keyboard and screen readers: - Tab: Reach the tree; it is one Tab stop. - Up or Down: Move to the previous or next item. - Right: Open a branch, or move into it. - Left: Close a branch, or move to its parent. - Letters: Jump to the item that starts with them. - Enter or Space: Select the item. - Read as a tree: each item says its level, whether it is open, and whether it is selected. ### Treemap Parts of a whole as areas, in groups: for many parts, where a pie has too few slices. The names are on the tiles where they fit; the tooltip and the table have them all. Docs: https://okaapi.dev/components/treemap-chart ```ts import { TreemapChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - Up to five parts: [Pie chart](https://okaapi.dev/components/pie-chart) - To compare the parts closely: [Bar chart](https://okaapi.dev/components/bar-chart) - Parts inside parts to open and close: [Tree](https://okaapi.dev/components/tree) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `name` | `string` | | Required. The row field with the name of a part. | | `value` | `string` | | Required. The row field with its number. | | `group` | `string` | | The row field with its group. | | `highlight` | `string` | | The group to bring forward; the others turn grey. | | `formatValue` | `(value: number) => string` | | Writes a number. | | `nameLabel` | `string` | | Names the column of names. | | `groupLabel` | `string` | | Names the column of groups. | | `valueLabel` | `string` | | Names the column of numbers. Defaults to Value. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `toggle` | `boolean` | `false` | The names become buttons that switch parts on and off. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Names are on the tiles at full contrast, over a soft tint of the group colour. ### Waterfall chart How a total is reached, step by step, up and down. Every bar starts where the one before ended, and says its change with a sign. Decreases have a texture as well as a colour. Docs: https://okaapi.dev/components/waterfall-chart ```ts import { WaterfallChart } from '@okaapi-ui/vue/charts'; ``` When to use something else: - Amounts that do not add up: [Bar chart](https://okaapi.dev/components/bar-chart) - How a total changes over time: [Area chart](https://okaapi.dev/components/area-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `label` | `string` | | Required. Names the chart, above it and for screen readers. | | `rows` | `object[]` | | Required. The data. | | `name` | `string` | | Required. The row field with the step's name. | | `value` | `string` | | Required. The row field with how much it adds or takes away. | | `total` | `string` | | The row field that is true where the bar is the total so far. | | `valueLabels` | `boolean` | `true` | Writes each change on its bar. | | `xLabel` | `string` | | Names the axis of steps, and the first table column. | | `yLabel` | `string` | | Names the axis of values. | | `formatValue` | `(value: number) => string` | | Writes a number. | | `description` | `string` | | A line of text under the name. | | `hideLabel` | `boolean` | `false` | Keeps the name for screen readers only. | | `height` | `number` | `280` | In pixels. The width follows the box around it. | | `legend` | `boolean` | | Shows the names and their colours. | | `table` | `boolean` | `true` | The button that shows the numbers as a table. | | `patterns` | `boolean` | `true` | Textures over the colours, so shapes differ without colour. | | `loading` | `boolean` | `false` | Shows that the rows are on their way. | | `emptyMessage` | `string` | | The words when there is nothing to draw. | | `locale` | `string` | | For numbers and dates. Defaults to the language of the page. | | `dir` | `'ltr' \| 'rtl'` | | Defaults to the direction of the page around it. | | `v-model:hidden` | `string[]` | | Keys of the parts that are off. | | `@rowSelect` | `row` | | The row under a click, Enter or Space. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - A sign and a texture tell a decrease from an increase, as well as the colour. # Plain HTML and CSS ## Setup (Plain HTML and CSS) ```sh pnpm add @okaapi-ui/css @okaapi-ui/icons pnpm add -D tailwindcss @tailwindcss/cli ``` ```css /* src/app.css */ @import 'tailwindcss'; @import '@okaapi-ui/css/tailwind.css'; @import '@okaapi-ui/icons/icons.css'; ``` The component markup uses icon classes, ``, drawn by `icons.css`. Every icon name is on https://okaapi.dev/foundations/icons ```sh npx @tailwindcss/cli -i src/app.css -o dist/app.css --watch ``` Without Tailwind, load `@okaapi-ui/css/ui.css` alone and use the `ui-` classes (`ui-p-4`, `ui-head-md`). The package ships no JavaScript: behaviour is yours to write, each page lists the elements and attributes it needs. Keep the `fonts` folder next to the CSS. ## Components (Plain HTML and CSS) ### Accordion A stack of sections that open and close, such as questions and answers. Built on the native details element, so it opens with Enter and Space, works without script, and the browser's find-in-page opens the section that holds the match. Sections grow and shrink smoothly both ways, Up and Down move between the headings, and the chevron mirrors in Arabic. Docs: https://okaapi.dev/components/accordion ```html
Can I change my order?

Yes, until it ships.

``` When to use something else: - Switch between views of the same thing, one at a time: [Tabs](https://okaapi.dev/components/tabs) - Hide one optional detail behind a button: [Popover](https://okaapi.dev/components/popover) - Show steps the reader must go through in order: [Stepper](https://okaapi.dev/components/stepper) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-accordion` | `class` | | The wrapper. | | `ui-accordion--icon-start` | `class` | | On the wrapper: the chevron before each heading. | | `ui-accordion__item` | `class` | | On each details; one name for one at a time. Add --icon-start or --no-icon for one item. | | `ui-accordion__heading, __description` | `class` | | Inside the summary: the heading text, and a quieter line. | | `ui-accordion__content` | `class` | | Around the content. It grows and shrinks; without script, Safari closes it at once. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Enter or Space: Open or close the section. - Up or Down: Move to the previous or next heading, wrapping round. - Home or End: Go to the first or last heading. - Native details elements: they open without script, and find in page opens the section that holds the match. - In plain HTML only the Up, Down, Home and End keys need script. ### Alert dialog A short message that needs an answer before the reader goes on: confirm a delete, keep or discard changes. Only its buttons answer: Escape and a click outside do nothing, because the reader has to choose. Focus starts on the safest button. Docs: https://okaapi.dev/components/alert-dialog ```html ... ``` When to use something else: - Ask for more than a yes or no, such as a form: [Dialog](https://okaapi.dev/components/dialog) - Confirm something that can be undone: [Toast with an Undo action](https://okaapi.dev/components/toast) - Warn about something on the page without stopping the reader: [Alert](https://okaapi.dev/components/alert) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `role="alertdialog"` | `attribute` | | On the dialog. Name and describe it with aria-labelledby and aria-describedby. | | `ui-dialog--alert` | `class` | | Centres the icon, heading and actions. | | `ui-dialog__icon--info \| --success \| --warning \| --danger` | `class` | | The tone icon, with aria-hidden="true". | | `autofocus` | `attribute` | | On the safest button, so focus starts there. | Keyboard and screen readers: - Tab or Shift + Tab: Move between its buttons; focus stays inside. - Escape and a click outside do nothing: only its buttons answer. - Focus starts on the safest button, and the title and message are read when it opens. ### Alert A message in the page, such as a problem with the whole form or a notice about the account. The title says what it is in words; the icon's shape and the colour repeat it. For a note after an action, use a toast; for a question that needs an answer, an alert dialog. Docs: https://okaapi.dev/components/alert ```html

Payment received

Invoice 1042 is paid.

``` When to use something else: - Confirm an action that just finished: [Toast](https://okaapi.dev/components/toast) - Stop the reader until they decide: [Alert dialog](https://okaapi.dev/components/alert-dialog) - Show a status in a row or a card: [Badge](https://okaapi.dev/components/badge) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-alert` | `class` | | On its own it is the info tone. | | `ui-alert--success \| --warning \| --danger` | `class` | | The tone. | | `ui-alert__icon, __body, __title, __actions, __close` | `class` | | The parts. Hide the icon from screen readers. | Keyboard and screen readers: - The title says what it is in words; the icon and the colour only repeat it. ### App shell The frame every screen of an app sits in: a header across the top, the main links in a side bar, the page beside them. When the shell is narrower than 64rem the side bar folds behind a menu button and opens over the page. Escape, the shade, or following a link closes it again. Docs: https://okaapi.dev/components/app-shell ```html
...
...
``` When to use something else: - Links in a side bar only, inside your own layout: [Navigation](https://okaapi.dev/components/nav) - Show where the page sits in the site: [Breadcrumbs](https://okaapi.dev/components/breadcrumbs) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-shell \| ui-shell--open` | `class` | | The frame; --open shows the folded side bar. | | `ui-shell__header \| __body \| __sidebar \| __main` | `class` | | Its parts. | | `--ui-shell-header \| --ui-shell-sidebar` | `token` | `4rem \| 16rem` | Header height and side bar width. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Enter or Space: On the menu button, open the side bar on a narrow screen. - Escape: Close the side bar. - The header, the side bar and the page are landmarks, so screen readers can jump between them. ### Area chart How much, over time: one amount, or parts that add up to a whole. Stacked parts have a texture as well as a colour, and one button shows the same numbers as a table. Docs: https://okaapi.dev/components/area-chart ```html ``` When to use something else: - Several values to compare over time: [Line chart](https://okaapi.dev/components/line-chart) - Amounts of separate things: [Bar chart](https://okaapi.dev/components/bar-chart) - Parts of one whole, at one moment: [Pie chart](https://okaapi.dev/components/pie-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Stacked parts differ by texture as well as colour; overlapping ones by the dash of their edge. ### Avatar group Several people in a small space: the first few avatars overlap and a '+3' stands for the rest. The group has a name, every avatar is still named, and '+3' is read as '3 more'. Docs: https://okaapi.dev/components/avatar-group ```html
…
``` When to use something else: - One person: [Avatar](https://okaapi.dev/components/avatar) - Every name visible, such as a list of attendees: [A list or Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-avatar-group` | `class` | | Overlaps the .ui-avatar children. Add role="group" and aria-label. | | `ui-avatar-group__more` | `class` | | On the "+n" avatar. Give it an aria-label such as "2 more". | Keyboard and screen readers: - The group has a name, every avatar is still named, and +3 is read as 3 more. ### Avatar A person's photo, or their initials when there is no photo or it fails to load. Screen readers hear the person's name, never the file name. Docs: https://okaapi.dev/components/avatar ```html HM ``` When to use something else: - Show several people in a small space: [Avatar group](https://okaapi.dev/components/avatar-group) - Show a status next to a person, such as online: [Status dot](https://okaapi.dev/components/status-dot) - A logo or a product picture: A plain img with alt text | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-avatar` | `class` | | Required. Add role="img" and aria-label with the name, or aria-hidden="true" when the name is beside it. | | `ui-avatar--sm \| --lg` | `class` | | The size. Without one it is 40 pixels. | | `--ui-avatar-size` | `custom property` | `2.5rem` | Any other size; the initials scale with it. | | `img alt=""` | `child` | | The photo. Its alt stays empty: the avatar itself carries the name. Swap to initials on its error event. | Keyboard and screen readers: - Screen readers hear the person’s name, never the file name. ### Badge A short status label, such as the state of an order. The words carry the meaning and the colour only repeats it, so every status reads the same without colour. Docs: https://okaapi.dev/components/badge ```html Paid ``` When to use something else: - A label the user added or can remove, such as a filter: [Tag](https://okaapi.dev/components/tag) - A live state such as online or offline: [Status dot](https://okaapi.dev/components/status-dot) - A message the reader must read: [Alert](https://okaapi.dev/components/alert) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-badge` | `class` | | Required. On its own it is the neutral badge. | | `ui-badge--info \| --success \| --warning \| --danger` | `class` | | The colour. Use one at most. | Keyboard and screen readers: - The words carry the status; the colour only repeats them. ### Bar chart Amounts to compare, as lengths from zero. Side by side, stacked, or as shares of a whole, upright or sideways. Each series has a texture as well as a colour, and one button shows the same numbers as a table. Docs: https://okaapi.dev/components/bar-chart ```html ``` When to use something else: - How a value changes over time: [Line chart](https://okaapi.dev/components/line-chart) - Parts of one whole, up to five: [Pie chart](https://okaapi.dev/components/pie-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) - One level inside a known range: [Meter](https://okaapi.dev/components/meter) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Bars differ by texture as well as colour, and a gap separates the parts of a stack. ### Bottom sheet A panel that slides up from the bottom of the screen, for a short choice or the details of an item, mostly on phones. It is a dialog docked to the bottom: focus moves into it and stays there, the page behind stops scrolling, and Escape, the close button or a click above it closes it. Docs: https://okaapi.dev/components/bottom-sheet ```html ... ``` When to use something else: - A task on a wide screen: [Dialog](https://okaapi.dev/components/dialog) - Navigation or filters that slide in from the side: [Drawer](https://okaapi.dev/components/drawer) - A short list of actions: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `dialog.ui-dialog.ui-dialog--sheet` | `element + class` | | Open it with showModal(), never show(), so focus is trapped and the page is inert. | | `ui-dialog--sm \| --lg` | `class` | | Its width on a wide screen: 24 or 48rem; 32rem without it. | | `everything else` | `` | | The same markup and classes as the dialog. | Keyboard and screen readers: - Tab or Shift + Tab: Move between the controls inside; focus stays inside. - Escape: Close, and put focus back on the button that opened it. - A dialog docked to the bottom, named by its title; the page behind stops scrolling. ### Box plot How values spread in each group. The box is the middle half, the thick line the median, the thin lines the rest, and a ring each value far from it. One button shows every number as a table. Docs: https://okaapi.dev/components/box-chart ```html ``` When to use something else: - One list of values: [Histogram](https://okaapi.dev/components/histogram-chart) - One amount for each group: [Bar chart](https://okaapi.dev/components/bar-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - The five numbers of each box are announced together. ### Breadcrumbs Where the page sits, as a trail of links back up. A named navigation landmark around an ordered list; the last item is the page itself, marked as current and not a link. The slashes are drawn, not read out. Docs: https://okaapi.dev/components/breadcrumbs ```html ``` When to use something else: - The main links of the app: [Navigation](https://okaapi.dev/components/nav) - Steps of a task in order: [Stepper](https://okaapi.dev/components/stepper) - Pages of a long list: [Pagination](https://okaapi.dev/components/pagination) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-breadcrumbs` | `class` | | On a nav with aria-label, around an ol. | | `aria-current="page"` | `attribute` | | On the last item, which is not a link. | Keyboard and screen readers: - A named navigation landmark around an ordered list; the last item is marked as the current page. - The slashes are drawn, not read out. ### Button group Buttons that belong together, joined into one bar. The group has a name, so a screen reader says what the buttons are for before it reads them. Docs: https://okaapi.dev/components/button-group ```html
…
``` When to use something else: - One choice that changes the view: [Segmented control](https://okaapi.dev/components/segmented-control) - Many controls with arrow-key movement, as in an editor: [Toolbar](https://okaapi.dev/components/toolbar) - More actions than fit on a phone: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-button-group` | `class` | | Joins the .ui-button children. Add role="group" and an aria-label. | Keyboard and screen readers: - Tab: Move from button to button. - A named group, read before its buttons. ### Button Styles the native button, so it keeps everything the browser gives a button: focus, Enter and Space, form submit. Nine variants, three sizes, icons, and hover, press and focus feedback. Docs: https://okaapi.dev/components/button ```html ``` When to use something else: - Go to another page: A link (a href) - A state that stays on or off, such as bold: [Toggle](https://okaapi.dev/components/toggle) - Several actions that belong together: [Button group](https://okaapi.dev/components/button-group) - More actions than fit, behind one button: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-button` | `class` | | Required on every button. | | `ui-button--primary \| --secondary \| --ghost \| --danger \| --outline \| --soft \| --link \| --success \| --warning` | `class` | | The variant. Use exactly one. | | `ui-button--sm \| --md \| --lg` | `class` | | The size. Use exactly one. | | `ui-button--icon, ui-button__icon` | `class` | | Square icon-only button; wrapper span (aria-hidden) for an icon beside a label. | | `aria-busy="true" + disabled` | `attribute` | | Loading state; add a span.ui-spinner with aria-hidden="true" before the label. | Keyboard and screen readers: - Enter or Space: Press the button. - A native button, so its role, focus and form submit come from the browser. - A button with only an icon needs a label in words for screen readers. ### Calendar A month grid to pick a day or a range, such as a delivery day or a stay. One Tab stop: arrow keys move by day and week, Home and End go to the ends of the week, Page Up and Page Down change the month, with Shift the year. Each day is read in full, Thursday, 19 November 2026. Today is underlined and picked days are filled, so neither depends on colour. Use it when seeing the month helps: open and closed days, a range, or the weekday. For a date people already know, such as a birthday, use the date field. Docs: https://okaapi.dev/components/calendar ```html
…
``` When to use something else: - A date the reader already knows, such as a birthday: [Date picker](https://okaapi.dev/components/date-picker) - A time or a date and time: [Text field with type time](https://okaapi.dev/components/text-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-calendar` | `class` | | The box; holds ui-calendar__header and ui-calendar__grid. | | `ui-calendar__day` | `class` | | One button per day, inside a gridcell. | | `--today \| --selected \| --in-range \| --disabled \| --outside` | `modifier` | | Underlined today, filled pick, range middle, struck through, hidden day of another month. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Tab: Reach the grid, on the chosen or focused day. - Left or Right: Move by a day. Flipped in Arabic. - Up or Down: Move by a week. - Home or End: Go to the start or end of the week. - Page Up or Page Down: Go to the previous or next month. - Shift + Page Up or Shift + Page Down: Go to the previous or next year. - Enter or Space: Pick the day. - Each day is read in full, such as Thursday, 19 November 2026. - Today is underlined and picked days are filled, so neither depends on colour. ### Candlestick chart Where a price opened and closed, and how far it went, each day. A rising day is hollow and a falling one filled, so colour only repeats it. One button shows the four prices as a table. Docs: https://okaapi.dev/components/candlestick-chart ```html ``` When to use something else: - Only the closing price: [Line chart](https://okaapi.dev/components/line-chart) - How values spread in groups: [Box plot](https://okaapi.dev/components/box-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Rising days are hollow and falling days filled, as well as two colours. ### Card A surface that groups related content: a summary, a list, a form. Cards are flat, with a thin border; shadows are kept for things that float, like menus and dialogs. Docs: https://okaapi.dev/components/card ```html
...
``` When to use something else: - Separate two groups with a line only: [Divider](https://okaapi.dev/components/divider) - Label and value pairs, such as order details: [Property list](https://okaapi.dev/components/property-list) - One number and how it changed: [Stat](https://okaapi.dev/components/stat) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-card` | `class` | | Required. Stacks its children with a 1rem gap. | | `ui-card--lg` | `class` | | More padding. | | `ui-card__title` | `class` | | On the heading (h2 to h4, to fit the page). | Keyboard and screen readers: - A card with a heading reads as its own part of the page; give it one when it stands alone. ### Checkbox A yes or no that is saved with the form, such as accepting the terms. The native checkbox in the primary colour; the whole label is the hit area, at least 44px tall. Docs: https://okaapi.dev/components/checkbox ```html ``` When to use something else: - One choice from a few options: [Radio group](https://okaapi.dev/components/radio-group) - A setting that takes effect at once: [Switch](https://okaapi.dev/components/switch) - Several choices from a long list: [Combobox or Chip input](https://okaapi.dev/components/chip-input) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-check` | `class` | | On the label that wraps the input and its text. | | `ui-field, ui-field--invalid` | `class` | | A wrapper when there is a hint or an error; list their ids in aria-describedby. | Keyboard and screen readers: - Space: Tick or untick it. - The native checkbox, named by its label; the whole label is the hit area. ### Chip input A text field that collects several short values, such as toppings, email addresses or skills. Each value becomes a tag with its own named remove button. Screen readers hear each value being added and removed, and focus never falls off the field. Docs: https://okaapi.dev/components/chip-input ```html
...
``` When to use something else: - One value from a known list: [Combobox](https://okaapi.dev/components/combobox) - A few choices that fit on screen: [Checkbox](https://okaapi.dev/components/checkbox) - Show labels the user cannot type: [Tag](https://okaapi.dev/components/tag) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-chips` | `class` | | The box that looks like a text field. | | `ui-chips__list \| __input` | `class` | | The list of tags and the text field. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Enter or ,: Add what is typed as a tag. - Backspace: In an empty field, move to the last tag’s remove button. - Enter or Space: On a remove button, remove that tag. - Each tag has its own remove button, named after its value. - Adding and removing are announced, and focus moves to the next tag or back to the field. ### Combo chart Bars with a line over them, on one scale: what happened beside what it is measured against. One scale only: two would make any two lines look related. One button shows the same numbers as a table. Docs: https://okaapi.dev/components/combo-chart ```html ``` When to use something else: - Only amounts to compare: [Bar chart](https://okaapi.dev/components/bar-chart) - Only change over time: [Line chart](https://okaapi.dev/components/line-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Bars and lines differ by their form; bars by texture and lines by dash as well as colour. ### Combobox A text field that filters a list as you type, for a long list such as countries. Focus stays in the field: arrow keys move through the matches, Enter picks one and Escape closes the list. The value is always one of the options. Docs: https://okaapi.dev/components/combobox ```html
  • Egypt
``` When to use something else: - One choice from fewer than about 10 options: [Select](https://okaapi.dev/components/select) - Several values: [Chip input](https://okaapi.dev/components/chip-input) - Find a page or run a command from anywhere: [Command palette](https://okaapi.dev/components/command-palette) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-input + role="combobox"` | `element` | | The field, with aria-expanded, aria-controls and aria-activedescendant. | | `ui-listbox, ui-option, ui-option--active` | `class` | | The list, as for the select. | | `ui-listbox__empty` | `class` | | The "no matches" line, with role="status". | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Up or Down: Open the list and move through the matches, wrapping round. - Enter: Pick the highlighted match. - Escape: Close the list. - Focus stays in the field; the highlighted match is read as it moves. ### Command palette A search over the app's actions, in a dialog. Ctrl+K or ⌘K opens it from anywhere; typing filters, the arrow keys move and Enter runs. Screen readers hear how many commands match as you type. Keep a visible button for it too: a shortcut nobody knows about is no way in. Docs: https://okaapi.dev/components/command-palette ```html ``` When to use something else: - Pick a value inside a form: [Combobox](https://okaapi.dev/components/combobox) - Search the items of one list: [Search field](https://okaapi.dev/components/search-field) - A few actions on one thing: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-command` | `class` | | The field and list inside a .ui-dialog. | | `ui-command__list \| __empty \| __shortcut` | `class` | | The list of .ui-option items, the no-match text, a key hint. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Ctrl + K or ⌘ + K: Open it from anywhere. - Up or Down: Move through the matching commands, wrapping round. - Enter: Run the highlighted command. - Escape: Close it. - How many commands match is announced as you type. - Keep a visible button for it too: a shortcut nobody knows about is no way in. ### Context menu Actions that open where the reader right-clicks, long-presses, or presses Shift+F10 on the focused item. It is a shortcut: the same actions must also be somewhere visible, because touch and keyboard users rarely look for one. Docs: https://okaapi.dev/components/context-menu ```html ``` When to use something else: - The visible way to the same actions: [Menu](https://okaapi.dev/components/menu) - Actions that should always be on screen: [Toolbar](https://okaapi.dev/components/toolbar) - Search every command in the app: [Command palette](https://okaapi.dev/components/command-palette) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-menu` | `class` | | The list, with role="menu". Opening, focus and keys are your script. | | `ui-menu__item` | `class` | | One action, with role="menuitem". --danger for red text. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Shift + F10 or Menu: Open the menu on the focused item. - Up or Down: Move through the actions. - Enter or Space: Run the action. - Escape: Close it. - It is a shortcut: the same actions must also be somewhere visible. ### Data table Rows of records the reader scans and compares: orders, users, payments. A real table, named by its caption, so screen readers announce the row and column of every cell. Sorting is announced too. Docs: https://okaapi.dev/components/data-table ```html
...
Orders
``` When to use something else: - A few label and value pairs: [Property list](https://okaapi.dev/components/property-list) - Events in time order: [Timeline](https://okaapi.dev/components/timeline) - Nested items such as folders: [Tree](https://okaapi.dev/components/tree) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-table-wrap` | `class` | | Scrolls sideways on narrow screens. If it can scroll, add tabindex="0", role="region" and aria-labelledby the caption. | | `table.ui-table + caption.ui-table__caption` | `element + class` | | The table and its name. Add ui-visually-hidden to the caption to hide it visually. | | `th scope="col"` | `attribute` | | On every header cell. | | `aria-sort + button.ui-table__sort` | `attribute + class` | | On sortable headers: ascending, descending or none. | | `ui-table__cell--end \| --center` | `class` | | Alignment, on the th and every td of the column. | | `ui-table__empty, ui-table__loading` | `class` | | The empty row, and the loading overlay with a status message. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Enter or Space: On a column heading, sort by it. - A real table named by its caption, so the row and column of every cell are read. - The sorted column is marked, and the new order is announced. ### Date picker A date to type or pick, or a range of dates for a stay. Type dates in the reader's own order, or open the calendar beside them or with Alt + Down. Unlike the browser's own picker, this calendar can close off days, such as a shop's day off. For ordinary dates and times, the native fields below use the browser's localized pickers. Date values stay plain ISO dates. Docs: https://okaapi.dev/components/date-picker ```html ``` When to use something else: - Pick days by looking at a month, or a range: [Calendar](https://okaapi.dev/components/calendar) - A time only: [Text field with type time](https://okaapi.dev/components/text-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `input.ui-input` | `element + class` | | With type="date", "time", "datetime-local" or "number", inside a ui-field. | | `ui-input-group` | `class` | | The box around the date field and the calendar button. | | `ui-date-picker__popover` | `class` | | With ui-popover, the panel that holds the calendar. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Alt + Down: Open the calendar from the field. - Escape: Close the calendar, and put focus back on the field. - The fields take dates typed in the reader’s own order; the calendar keys are listed on the Calendar page. ### Dialog A modal window for a task that needs the reader's full attention: a short form, details, terms. Focus moves into it and stays there, the page behind stops scrolling, and Escape, the close button or a click outside closes it. Docs: https://okaapi.dev/components/dialog ```html ... ``` When to use something else: - A yes or no question that must be answered: [Alert dialog](https://okaapi.dev/components/alert-dialog) - Content beside the page, such as filters: [Drawer](https://okaapi.dev/components/drawer) - A short note next to the button: [Popover](https://okaapi.dev/components/popover) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `dialog.ui-dialog` | `element + class` | | Open it with showModal(), never show(), so focus is trapped and the page is inert. | | `ui-dialog--sm \| --lg` | `class` | | 24 or 48rem wide; 32rem without it. | | `closedby="any"` | `attribute` | | A click outside closes it too, in browsers that support it; Escape always does. closedby="none" plus oncancel="event.preventDefault()": only your buttons close it. | | `aria-labelledby / aria-describedby` | `attribute` | | Point at the title and the description ids. | | `ui-dialog__header, __heading, __title, __description` | `class` | | The heading area. | | `ui-dialog__body` | `class` | | The content; it scrolls when it is long. | | `form[method="dialog"] + ui-dialog__actions` | `element + class` | | Buttons inside close the dialog and set returnValue to their value. | Keyboard and screen readers: - Tab or Shift + Tab: Move between the controls inside; focus stays inside. - Escape: Close, and put focus back on the button that opened it. - Named by its title; the page behind stops scrolling and cannot be reached. ### Divider A thin line between groups of content. Reach for space first: a divider is for when space alone does not show where one group ends. Docs: https://okaapi.dev/components/divider ```html
``` When to use something else: - A frame around a group: [Card](https://okaapi.dev/components/card) - Space between groups: Tailwind gap or margin classes | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-divider` | `class` | | Required. On an hr it is a separator already; on a div add role="separator". | | `ui-divider--vertical` | `class` | | Vertical. Add aria-orientation="vertical". | | `ui-divider--label` | `class` | | Words in the middle. No separator role, so the words are read. | Keyboard and screen readers: - Read as a separator; a divider with words in the middle is read as those words instead. ### Drawer A side panel that slides in from the edge, for a form or the details of a row, while the list stays in sight. It is a dialog docked to the side: focus moves into it and stays there, the page behind stops scrolling, only the body scrolls, and Escape, the close button or a click outside closes it. Docs: https://okaapi.dev/components/drawer ```html ... ``` When to use something else: - A focused task in the middle of the screen: [Dialog](https://okaapi.dev/components/dialog) - A panel on a phone: [Bottom sheet](https://okaapi.dev/components/bottom-sheet) - The main links of the app on a phone: [App shell](https://okaapi.dev/components/app-shell) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `dialog.ui-dialog.ui-dialog--drawer` | `element + class` | | Open it with showModal(), never show(), so focus is trapped and the page is inert. | | `ui-dialog--sm \| --lg` | `class` | | 24 or 48rem wide; 32rem without it. | | `everything else` | `` | | The same markup and classes as the dialog. | Keyboard and screen readers: - Tab or Shift + Tab: Move between the controls inside; focus stays inside. - Escape: Close, and put focus back on the button that opened it. - A dialog docked to the side, named by its title; the page behind stops scrolling. ### Empty state What a list, table or page shows while it has nothing in it. It says what will appear here, why it is empty now, and offers the one action that fills it. Docs: https://okaapi.dev/components/empty-state ```html
...
``` When to use something else: - Content that is still loading: [Skeleton](https://okaapi.dev/components/skeleton) - Something went wrong: [Alert](https://okaapi.dev/components/alert) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-empty-state` | `class` | | Required. Centres its content. | | `ui-empty-state__title` | `class` | | On the heading. | | `ui-empty-state__actions` | `class` | | Around the buttons. | Keyboard and screen readers: - Its title is a heading, at the level you set so it fits the page outline. ### Fieldset A titled group of fields inside a longer form. Screen readers read the legend as they enter the group, so a field called Street is heard as part of the delivery address. Docs: https://okaapi.dev/components/fieldset ```html
Delivery address …fields
``` When to use something else: - A frame around content that is not a form: [Card](https://okaapi.dev/components/card) - One choice from a few, with a group label: [Radio group](https://okaapi.dev/components/radio-group) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-fieldset` | `class` | | On the fieldset; spaces the fields in it. | | `ui-fieldset__legend` | `class` | | On its legend. | Keyboard and screen readers: - The legend is read when focus enters the group, so each field is heard as part of it. ### File field The browser's own file input, with a label, hint and error, in a zone that also takes files dropped on it. The native button and file names stay, so it works with the keyboard, screen readers and phone cameras as usual. Docs: https://okaapi.dev/components/file-field ```html ``` When to use something else: - Typed text or a link to a file: [Text field](https://okaapi.dev/components/text-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-file` | `class` | | On the input type="file". | | `ui-dropzone` | `class` | | The dashed zone around it. | | `ui-dropzone--over` | `class` | | While a file is dragged over the zone. | | `ui-dropzone__text` | `class` | | The line under the button. | Keyboard and screen readers: - Enter or Space: Open the file chooser. - The browser’s own file input: the button and the chosen file names are read as usual. - Dropping files is a shortcut; the button always works. ### Funnel chart How many are left after each step: visits, baskets, orders. Every step says its number and its share of the first, so the width only repeats it. One button shows it as a table. Docs: https://okaapi.dev/components/funnel-chart ```html ``` When to use something else: - Amounts that are not steps: [Bar chart](https://okaapi.dev/components/bar-chart) - Steps the reader goes through: [Stepper](https://okaapi.dev/components/stepper) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - The number and share of each step are written beside it. ### Gauge chart One level inside a known range, as a ring. The value is written in the middle and read with the name, so the colour only repeats it. For a list of levels use Meter: it takes less room. Docs: https://okaapi.dev/components/gauge-chart ```html ``` When to use something else: - Several levels, or little room: [Meter](https://okaapi.dev/components/meter) - Work that is still going: [Progress](https://okaapi.dev/components/progress) - One number and how it changed: [Stat](https://okaapi.dev/components/stat) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the gauge, then its next control. - A named graphic, read in one go. - The same numbers are always there as a real table. - The value and its zone are part of the name, so they are read at once. ### Heatmap Where a number is high or low across two lists, such as days and hours. Five steps of one colour, light to dark, with the number in each cell where there is room. One button shows it as a table. Docs: https://okaapi.dev/components/heatmap-chart ```html ``` When to use something else: - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) - One list of amounts: [Bar chart](https://okaapi.dev/components/bar-chart) - A day to choose: [Calendar](https://okaapi.dev/components/calendar) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - The number is written in the cell at 7:1 on its colour, or in the table. ### Histogram How many values fall in each range: delivery times, order sizes, ages. The ranges have round edges, and one button shows them as a table. Docs: https://okaapi.dev/components/histogram-chart ```html ``` When to use something else: - To compare groups: [Box plot](https://okaapi.dev/components/box-chart) - Amounts with names: [Bar chart](https://okaapi.dev/components/bar-chart) - Two numbers that go together: [Scatter chart](https://okaapi.dev/components/scatter-chart) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Each range and its count are announced together. ### Icons A small set of sharp, adaptable marks. Find one by name or meaning, then shape it to fit. Docs: https://okaapi.dev/foundations/icons ### Input group A text field with fixed text inside its box, before or after the value: a currency, a unit, a domain. The text is read with the field, so 'Price, EGP' is heard, but it is never part of the value. Docs: https://okaapi.dev/components/input-group ```html
……
``` When to use something else: - A number with − and + buttons: [Number field](https://okaapi.dev/components/number-field) - A phone number with its country code: [Phone field](https://okaapi.dev/components/phone-field) - A search box with a clear button: [Search field](https://okaapi.dev/components/search-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-input-group` | `class` | | The box around the input and its text. | | `ui-input-group__input` | `class` | | The input. aria-describedby points at the addons so they are read. | | `ui-input-group__addon` | `class` | | Text before the input; add --end for text after it. | Keyboard and screen readers: - The text before or after the value is read with the field, such as Price, EGP, but is never part of the value. ### Keyboard key A key to press, on the native kbd element, so screen readers and search engines know it is a key. For a shortcut write one key per element, with the joining + as plain text. Docs: https://okaapi.dev/components/kbd ```html Esc ``` When to use something else: - Code or a value the reader types, such as a coupon: A plain code element - A short label for a status: [Badge](https://okaapi.dev/components/badge) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-kbd` | `class` | | On a kbd element: one per key. | Keyboard and screen readers: - The native kbd element, so screen readers and search engines know it is a key. ### Language switcher Switches the interface language. Each language is named in itself, so someone who reads only that language can find it, and carries its lang, so screen readers say it in the right voice. No flags: a flag is a country, not a language. Set lang and dir on the html element when the language changes. Docs: https://okaapi.dev/components/language-switcher ```html عربي ``` When to use something else: - Any other choice from a list: [Select](https://okaapi.dev/components/select) - Switch between views of a page: [Segmented control](https://okaapi.dev/components/segmented-control) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `lang` | `attribute` | | On each language name, with its own code. | | `ui-menu__item[aria-checked="true"]` | `selector` | | The current language in a menu: bold, with a check mark. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Enter or Space or Down: Open the list of languages. - Up or Down: Move through the languages. - Escape: Close it, and put focus back on the button. - Each language is named in itself and carries its lang, so it is read in the right voice. ### Line chart How values change over time or along a scale. Every line differs by dash as well as colour, the arrow keys walk the values, and one button shows the same numbers as a table. Time runs from right to left in Arabic. Docs: https://okaapi.dev/components/line-chart ```html ``` When to use something else: - One number and how it changed: [Stat](https://okaapi.dev/components/stat) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) - A level inside a known range: [Meter](https://okaapi.dev/components/meter) - What happened, in order, in words: [Timeline](https://okaapi.dev/components/timeline) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four line colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for lines in the background. | | `--ui-chart-band` | `CSS token` | | The strip of a normal range. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Lines differ by dash as well as colour, and text is never drawn in a line colour. ### Menu A short list of actions that opens from a button, such as the actions on a row. Enter, Space or the down arrow open it, the arrow keys and typing move through it, and Escape closes it and puts focus back on the button. For choosing a value, use a select. Docs: https://okaapi.dev/components/menu ```html ``` When to use something else: - The same actions on right-click or a long press: [Context menu](https://okaapi.dev/components/context-menu) - Pick a value that a form sends: [Select](https://okaapi.dev/components/select) - Links that go to other pages: [Navigation](https://okaapi.dev/components/nav) - Two or three actions that fit on screen: [Button group](https://okaapi.dev/components/button-group) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-menu` | `class` | | On the element with role="menu". | | `ui-menu__item` | `class` | | On each role="menuitem". | | `ui-menu__item--danger` | `class` | | Red text, for a destructive action. | | `ui-menu__separator` | `class` | | A line between groups, with role="separator". | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Enter or Space or Down: Open the menu from its button. - Up or Down: Move through the actions. - Letters: Jump to the action that starts with them. - Enter or Space: Run the action. - Escape: Close it, and put focus back on the button. - Read as a menu of items; the button says it opens a menu. ### Meter A level inside a known range: storage used, a plan's limit, a score. It is not work in progress, that is Progress. The value is written next to the label, so the tone colour only repeats what the words say. Docs: https://okaapi.dev/components/meter ```html
…
…
``` When to use something else: - Work that is still going, such as an upload: [Progress](https://okaapi.dev/components/progress) - One number and how it changed: [Stat](https://okaapi.dev/components/stat) - A value the reader sets: [Slider](https://okaapi.dev/components/slider) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-meter` | `class` | | The wrapper. Tones: ui-meter--success, --warning, --danger. | | `ui-meter__bar` | `class` | | The track: role="meter", aria-labelledby, aria-valuenow/min/max and aria-valuetext. | | `--ui-meter-value` | `CSS length` | | On ui-meter__fill: how full, as a percentage. | Keyboard and screen readers: - The native meter, named by its label, with the value in words beside it. ### Navigation The app's main links, in a side bar. A named navigation landmark, links at least 44px tall, and the current page marked with a bar and bold text, not only a fill. On a phone, put the same links in a drawer. Docs: https://okaapi.dev/components/nav ```html ``` When to use something else: - A whole app layout with header and side bar: [App shell](https://okaapi.dev/components/app-shell) - Views of one page: [Tabs](https://okaapi.dev/components/tabs) - Where the page sits in the site: [Breadcrumbs](https://okaapi.dev/components/breadcrumbs) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-nav` | `class` | | On a nav with aria-label. | | `ui-nav__title` | `class` | | A group title; add ui-label for the mono caps. | | `aria-current="page"` | `attribute` | | On the current page's link. | Keyboard and screen readers: - A named navigation landmark; the current page is marked for screen readers and with a bar and bold text. ### Number field A number with − and + either side. Type it, in Latin or Arabic digits, or step it with the buttons, the arrow keys, or Page Up and Down for ten steps. On leaving the field it stays inside its limits and is written in the reader's language. Docs: https://okaapi.dev/components/number-field ```html
...
``` When to use something else: - A rough amount on a scale: [Slider](https://okaapi.dev/components/slider) - A code such as an ID or a card number: [Text field](https://okaapi.dev/components/text-field) - A price with a currency beside it: [Input group](https://okaapi.dev/components/input-group) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-number-field` | `class` | | On the field: centres the number between the buttons. | | `ui-input-group__button` | `class` | | The − and + buttons, out of the Tab order. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Up or Down: Step up or down by one step. - Page Up or Page Down: Step by ten steps. - Home or End: Go to the lowest or highest value, when there is one. - Enter: Keep the value inside its limits and write it out. - Latin and Arabic digits are both taken; the − and + buttons are named. ### Pagination Moves through long lists a page at a time. A named navigation landmark: each page button says its number, the current page is marked, and the line of shown rows is announced when it changes. Docs: https://okaapi.dev/components/pagination ```html ``` When to use something else: - Steps of a task: [Stepper](https://okaapi.dev/components/stepper) - Where the page sits in the site: [Breadcrumbs](https://okaapi.dev/components/breadcrumbs) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `nav.ui-pagination + aria-label` | `element + class` | | A named navigation landmark. | | `ui-pagination__summary role="status"` | `class + attribute` | | Which rows are shown, announced when it changes. | | `ui-pagination__page + aria-label + aria-current` | `class + attribute` | | Name every page button, and mark the current one with aria-current="page". | | `ui-pagination__step + aria-disabled` | `class + attribute` | | Previous and next; at the ends use aria-disabled="true", not disabled. | | `ui-pagination__gap aria-hidden` | `class + attribute` | | The "…" between page numbers. | Keyboard and screen readers: - Tab: Move between the page buttons. - A named navigation landmark; each button says its page number, and the current page is marked. - The line of shown rows is announced when it changes. ### Phone field A phone number with its country code. The number reads left to right in every language, Arabic digits are welcome, and the 0 people type before a mobile number out of habit is dropped. What the form gets is one international number, ready to send a text to. Docs: https://okaapi.dev/components/phone-field ```html
...
``` When to use something else: - Any other number: [Number field](https://okaapi.dev/components/number-field) - A one-time code sent by SMS: [PIN input](https://okaapi.dev/components/pin-input) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-phone-field__flag--world` | `class` | | On a flag outside the default countries: draws it from the larger font. | | `ui-phone-field` | `class` | | On the field: the box reads left to right. | | `ui-phone-field__country` | `class` | | A country-picker trigger inside the box. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Up or Down: On the country button, open the list of countries. - Up or Down or Home or End: In the list, move through the countries. - Enter or Space: Pick the country. - Escape or Tab: Close the list. - The country button is read with the country and its code; the number reads left to right in every language. ### Pie chart Parts of one whole, at one moment. Up to five slices: people judge angles badly, so the rest join into one. Every slice has a texture and its share in words, and one button shows every number as a table. Docs: https://okaapi.dev/components/pie-chart ```html ``` When to use something else: - More than five parts, or a close comparison: [Bar chart](https://okaapi.dev/components/bar-chart) - How the mix changes over time: [Area chart](https://okaapi.dev/components/area-chart) - One level inside a known range: [Meter](https://okaapi.dev/components/meter) - One number and how it changed: [Stat](https://okaapi.dev/components/stat) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Slices differ by texture as well as colour, and the legend writes the share of each. ### PIN input A code sent by text message, one box per digit. Typing moves along, Backspace goes back, and pasting the code fills every box. On a phone the keyboard offers the code from the message, and the boxes take it all at once. Docs: https://okaapi.dev/components/pin-input ```html
Verification code
...
``` When to use something else: - A password: [Text field with type password](https://okaapi.dev/components/text-field) - A phone number: [Phone field](https://okaapi.dev/components/phone-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-pin` | `class` | | The row of boxes, a named group. Always left to right. | | `ui-pin__cell` | `class` | | With ui-input, one box. placeholder=" " lets a filled box show darker. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - A digit: Fill the box and move to the next one. - Backspace: In an empty box, go back to the one before. - Left or Right: Move to the box before or after. - Home or End: Go to the first or last box. - Pasting the code fills every box, and phones offer the code from the message. ### Popover A small panel next to its button, for a few details or a couple of settings. It is not modal: focus moves into it, and Escape or a click outside closes it and puts focus back on the button. Screen readers name it after the button. For a task that needs the reader's full attention, use a dialog. Docs: https://okaapi.dev/components/popover ```html ``` When to use something else: - A short label for an icon button: [Tooltip](https://okaapi.dev/components/tooltip) - A list of actions: [Menu](https://okaapi.dev/components/menu) - A task that needs the reader’s full attention: [Dialog](https://okaapi.dev/components/dialog) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-popover` | `class` | | On the panel, with role="dialog" named by its button. | | `ui-popover__title` | `class` | | A bold first line. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Enter or Space: Open it from its button; focus moves in. - Escape: Close it, and put focus back on the button. - Named after its button. It is not modal, so the page stays reachable. ### Progress How far a long task has got, such as an upload. The native progress bar, named by its label, with the amount in words beside it. Without a value it shows a moving band: work is going on but its length is not known. Docs: https://okaapi.dev/components/progress ```html
Uploading invoice.pdf
``` When to use something else: - A level that is not work being done, such as storage used: [Meter](https://okaapi.dev/components/meter) - Waiting with no idea how long: [Spinner](https://okaapi.dev/components/spinner) - Steps the reader goes through: [Stepper](https://okaapi.dev/components/stepper) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-progress` | `class` | | The wrapper: label, amount, bar. | | `ui-progress__bar` | `class` | | On the progress element, named with aria-labelledby. | | `ui-progress__label, __value` | `class` | | The words above it; hide the amount from screen readers. | Keyboard and screen readers: - The native progress bar, named by its label, with the amount in words beside it. - Without a value it shows a moving band: work is going on but its length is not known. ### Property list Label and value pairs, such as the details of one order. Built on the native description list, so screen readers say how many items there are and pair each label with its value. Docs: https://okaapi.dev/components/property-list ```html
…
``` When to use something else: - Many records with the same fields: [Data table](https://okaapi.dev/components/data-table) - One headline number: [Stat](https://okaapi.dev/components/stat) - Values the reader edits: [Text field and the other form fields](https://okaapi.dev/components/text-field) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-property-list` | `class` | | On a dl. Add --stacked for labels above values. | | `ui-property-list__item` | `class` | | A div holding one dt and one dd. | Keyboard and screen readers: - The native description list, so each label is paired with its value. ### Radar chart Several measures of one thing, or of two or three, around a circle. For the shape, not for exact values: bars compare better. Lines differ by dash as well as colour, and one button shows the numbers as a table. Docs: https://okaapi.dev/components/radar-chart ```html ``` When to use something else: - To compare the values exactly: [Bar chart](https://okaapi.dev/components/bar-chart) - How two numbers go together: [Scatter chart](https://okaapi.dev/components/scatter-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Shapes differ by the dash of their line as well as colour. ### Radio group One choice from a short list, with every option in view. Native radios: Tab reaches the group, arrow keys move the choice. For more than five or six options, use a select. Docs: https://okaapi.dev/components/radio-group ```html
Delivery
``` When to use something else: - Several choices at once: [Checkbox](https://okaapi.dev/components/checkbox) - More than about 7 options: [Select](https://okaapi.dev/components/select) - Switch the view of the page: [Segmented control](https://okaapi.dev/components/segmented-control) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `role="radiogroup"` | `attribute` | | On the ui-field wrapper, with aria-labelledby pointing at the label. | | `ui-choices` | `class` | | Holds the radios, one per line. | | `ui-choices--inline` | `class` | | Puts them side by side. | | `ui-check` | `class` | | On each label that wraps a radio. Give every radio the same name. | Keyboard and screen readers: - Tab: Reach the group, on the chosen option. - Arrow keys: Move the choice to the next or previous option. - Native radios in a named group, so the group name is read first. ### Rating Stars out of five, to pick a score or to show one. Picking uses real radio buttons, so Tab reaches the stars, arrow keys move between them and a screen reader says 3 stars, 3 of 5. Filled stars are solid and empty ones an outline, so the shape tells them apart, not only colour. Docs: https://okaapi.dev/components/rating ```html
...
``` When to use something else: - An exact number: [Number field](https://okaapi.dev/components/number-field) - Show a score the reader cannot change: [Meter](https://okaapi.dev/components/meter) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-rating` | `class` | | On the fieldset, or on the read-only span with role="img". | | `ui-rating__star` | `class` | | One label per star, holding a hidden radio and its name. | | `ui-rating--readonly \| ui-rating__star--on` | `class` | | Read-only score, and the stars it fills. | Keyboard and screen readers: - Tab: Reach the group, on the chosen option. - Arrow keys: Move the choice to the next or previous option. - Real radio buttons, read as 3 stars, 3 of 5. - Filled stars are solid and empty ones an outline, so shape tells them apart. ### Scatter chart Two numbers for each thing, to see whether they go together. A third number makes bubbles. Groups differ by shape as well as colour, and one button shows the same numbers as a table. Docs: https://okaapi.dev/components/scatter-chart ```html ``` When to use something else: - How one number changes over time: [Line chart](https://okaapi.dev/components/line-chart) - Amounts to compare: [Bar chart](https://okaapi.dev/components/bar-chart) - Exact values to read and sort: [Data table](https://okaapi.dev/components/data-table) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `--ui-chart-1 … --ui-chart-4` | `CSS token` | | The four colours, light and dark. | | `--ui-chart-muted` | `CSS token` | | The grey for what is in the background. | Keyboard and screen readers: - Tab: Reach the chart, then its next control. - Arrow keys: Move to the next or previous value. - Home or End: Go to the first or last value. - Enter or Space: Pin the value, and open its row if the page uses it. - Escape: Unpin the value. - A named graphic. Each value is announced as you reach it. - The same numbers are always there as a real table. - Groups differ by shape as well as colour, and the trend line is dashed. ### Search field A box to search with: a magnifier, the text, and a × to clear it. Escape clears it too, and Enter searches. A real search input, so phones show a Search key and screen readers say search. Docs: https://okaapi.dev/components/search-field ```html
...
``` When to use something else: - Search the whole app and run commands: [Command palette](https://okaapi.dev/components/command-palette) - Pick one value from a list as you type: [Combobox](https://okaapi.dev/components/combobox) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-input-group` | `class` | | The box around the input, icon and button. Rings while the input has focus. | | `ui-input-group__addon \| __input \| __button` | `class` | | The magnifier, the input and the × button. | Keyboard and screen readers: - Enter: Search. - Escape: Clear the text. - A real search input, read as search; the clear button is named. ### Segmented control One choice from two to five short options, side by side: a view, a period, a size. Radio buttons underneath, so Tab reaches the group and the arrow keys move the choice. The chosen one is lifted onto a tile with an edge, not just coloured. Docs: https://okaapi.dev/components/segmented-control ```html
...
``` When to use something else: - Show different panels of content: [Tabs](https://okaapi.dev/components/tabs) - A choice sent with a form: [Radio group](https://okaapi.dev/components/radio-group) - One option that is on or off: [Toggle](https://okaapi.dev/components/toggle) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-segmented` | `class` | | The track, with role="radiogroup" and a name. | | `ui-segmented__option` | `class` | | One label around a radio; the radio fills it, unseen. | | `ui-segmented--block` | `class` | | Full width. | Keyboard and screen readers: - Tab: Reach the group, on the chosen option. - Arrow keys: Move the choice to the next or previous option. - Radio buttons underneath; the chosen option is lifted onto a tile with an edge, not only coloured. ### Select One choice from a list. Arrow keys, Home and End, and typing the first letters all move through the options; Escape and Tab close the list and return focus. Docs: https://okaapi.dev/components/select ```html ``` When to use something else: - A long list the reader searches: [Combobox](https://okaapi.dev/components/combobox) - Two to five options that fit on screen: [Radio group](https://okaapi.dev/components/radio-group) - Actions, not values: [Menu](https://okaapi.dev/components/menu) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `select.ui-input` | `element + class` | | A native select inside a ui-field, with a label as for the text field. | | `aria-invalid="true"` | `attribute` | | With a ui-field__error message listed in aria-describedby. | Keyboard and screen readers: In plain HTML these keys come from your own script, following the matching WAI-ARIA pattern. - Enter or Space or Up or Down: Open the list. - Up or Down or Home or End: Move through the options. - Letters: Jump to the option that starts with them. - Enter or Space: Pick the option. - Escape or Tab: Close the list, and put focus back on the button. - Read as a list box, with the chosen option and the field’s label. ### Skeleton Grey shapes where content is loading, so the page does not jump when it arrives. Screen readers skip the shapes: mark the area busy and say it is loading with a spinner or a status message. With reduced motion the shapes stop pulsing. Docs: https://okaapi.dev/components/skeleton ```html ``` When to use something else: - Work with a known length: [Progress](https://okaapi.dev/components/progress) - A short wait inside a button: [Spinner](https://okaapi.dev/components/spinner) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-skeleton` | `class` | | The wrapper, with aria-hidden="true". | | `ui-skeleton--text \| --circle \| --block` | `class` | | The shape. | | `ui-skeleton__shape` | `class` | | One grey shape; one per line of text. | Keyboard and screen readers: - Screen readers skip the shapes: mark the area busy and say it is loading in words. - With reduced motion the shapes stop pulsing. ### Slider A value picked along a range, such as a price limit or a volume. It is the browser's own range input, so arrow keys, Page Up and Down, Home and End all move it, and the value is written beside the label. For an exact number, use a number field. Docs: https://okaapi.dev/components/slider ```html ``` When to use something else: - An exact value: [Number field](https://okaapi.dev/components/number-field) - Show a level the reader cannot change: [Meter](https://okaapi.dev/components/meter) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-slider` | `class` | | On the range input. | | `--ui-slider-fill` | `custom property` | `0%` | How much of the track is filled, in WebKit browsers. Set it on input. | | `ui-slider__head \| __value` | `class` | | The row with the label and the written value. | Keyboard and screen readers: - Left or Right or Up or Down: Move by one step. - Page Up or Page Down: Move by a bigger step. - Home or End: Go to the lowest or highest value. - The browser’s own range input, named by its label; the value is also written beside it. ### Spinner Shows that something is loading and says what, in words, to screen readers. Keep it for waits of more than a second. With reduced motion it stops turning and stays as a faint ring. Docs: https://okaapi.dev/components/spinner ```html Loading orders ``` When to use something else: - Work with a known length: [Progress](https://okaapi.dev/components/progress) - A whole page or card that is loading: [Skeleton](https://okaapi.dev/components/skeleton) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-loading` | `class` | | The spinner and its words, with role="status". | | `ui-loading--lg` | `class` | | The big one, over its label. | | `ui-spinner` | `class` | | The ring; hide it from screen readers. | Keyboard and screen readers: - Says what is loading, in words, to screen readers. - With reduced motion it stops turning and stays as a faint ring. ### Stat One number with its label, and how it changed. The change is written out, with its sign or in words; the arrow and the colour only repeat it. Docs: https://okaapi.dev/components/stat ```html
...
``` When to use something else: - A level against a limit, such as 70% of storage: [Meter](https://okaapi.dev/components/meter) - Several label and value pairs: [Property list](https://okaapi.dev/components/property-list) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-stat` | `class` | | Required. Label, value and change stack in that order, which is also the reading order. | | `ui-stat__label \| __value \| __change` | `class` | | The three lines. | | `ui-stat__change--positive \| --negative` | `class` | | The colour of the change. Put aria-hidden on its arrow. | Keyboard and screen readers: - The change is written out, with its sign or in words; the arrow and colour only repeat it. ### Status dot A small coloured dot before the word for a live state: online, busy, offline. The word is always there and carries the meaning; the dot lets the eye scan a long list. Docs: https://okaapi.dev/components/status-dot ```html Online ``` When to use something else: - A status that stands out in a table row, such as Paid: [Badge](https://okaapi.dev/components/badge) - A message about the status: [Alert](https://okaapi.dev/components/alert) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-status-dot` | `class` | | On a span holding the word. Tones: --info, --success, --warning, --danger. | Keyboard and screen readers: - The word is always there and carries the meaning; the dot is not read. ### Stepper A flow split into steps, such as checkout. Each step holds its own content, and the stepper shows the current one with Back and Next under it. The step names are buttons, so people can go back. Done steps have a tick and are read as Done, the current one is announced as the current step, and focus moves to the new step's content after each change. Docs: https://okaapi.dev/components/stepper ```html
    ...
...
...
``` When to use something else: - Views the reader can open in any order: [Tabs](https://okaapi.dev/components/tabs) - Pages of a list: [Pagination](https://okaapi.dev/components/pagination) - What happened to a request, in time order: [Timeline](https://okaapi.dev/components/timeline) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-stepper` | `class` | | Wraps the list, the panels and the buttons. | | `ui-steps` | `class` | | On the ol. Give it an aria-label. | | `ui-steps__item--done \| --current` | `class` | | Per li. Put aria-current="step" on the current button, and "Done: " in a ui-visually-hidden span on done ones. | | `ui-steps__step` | `class` | | The button in each li. Disable it while the step cannot be reached. | | `ui-steps__marker \| __label` | `class` | | The circle (aria-hidden) and the name. | | `ui-stepper__panel \| __actions` | `class` | | One panel per step, hidden except the current one, with tabindex="-1" so focus can move to it; then the Back and Next row. | Keyboard and screen readers: - Tab: Reach the step names, Back and Next. - Done steps are read as Done and the current one as the current step. - Focus moves to the new step’s content after each change. ### Switch An on or off setting that takes effect at once, with no save button. Screen readers say on and off, and the knob's side shows the state, so it never depends on colour. For a choice saved with a form, use a checkbox. Docs: https://okaapi.dev/components/switch ```html ``` When to use something else: - A choice sent with a form: [Checkbox](https://okaapi.dev/components/checkbox) - A pressed state in a toolbar, such as bold: [Toggle](https://okaapi.dev/components/toggle) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-switch` | `class` | | On the label: the text, then the input. | | `ui-switch__input` | `class` | | On an input type="checkbox" with role="switch". | Keyboard and screen readers: - Space: Turn it on or off. - A checkbox with the switch role, so screen readers say on and off. ### Tabs Views of one thing side by side, such as an order's details and its history. Tab reaches the chosen tab, the arrow keys move between tabs and show each one, Home and End go to the first and last. The chosen tab gets a bar and full-strength text, not only a colour. Docs: https://okaapi.dev/components/tabs ```html
…
``` When to use something else: - Links to other pages: [Navigation](https://okaapi.dev/components/nav) - Change how the same content is shown: [Segmented control](https://okaapi.dev/components/segmented-control) - Sections the reader may open together: [Accordion](https://okaapi.dev/components/accordion) | Name | Type | Default | What it does | | --- | --- | --- | --- | | `ui-tabs` | `class` | | The wrapper. | | `ui-tabs__list` | `class` | | On the element with role="tablist", or on a