Vois components

From ommakes/Skills · View interactive version

Vois components is an AI agent skill from the GitHub repository ommakes/Skills. Component selection rubrics organized by job-to-be-done. Use after vois-patterns determines structure, before vois-tokens applies tokens. Optionally records each choice via the vois_record_component_choice MCP tool if one is available. Use when deciding between similar components — Dialog vs Drawer,

How to use this skill

Skill file

Vois Component Selection Skill

You are picking specific components from the workspace manifest. This skill answers "which component for this job" — not what structure (that's vois-patterns) and not how to style it (that's vois-tokens).

Read this skill after vois-patterns has determined the container type. If a vois_record_component_choice tool is available in your environment, call it for every component you pick before moving to vois-tokens; if not, just make the selection and move on.

The Quick Reference table below resolves most cases on its own. When it doesn't — ambiguous case, need the full decision tree, or need to justify the choice — read the matching reference file.


Before You Pick a Component

  1. Identify the job-to-be-done — phrase it as a verb plus object: "confirm a destructive action", "show transient feedback", "group related controls"
  2. Find the matching row in Quick Reference, or the matching job in the index below
  3. If ambiguous, read the matching reference file and walk its decision tree
  4. If a vois_record_component_choice tool is available, call it with your selection:

```

Tool: vois_record_component_choice

Arguments:

job: <the job-to-be-done, one sentence, e.g. "confirm destructive action">

componentName: <exact component name from the manifest, e.g. "AlertDialog">

alternativesConsidered: <optional array of component names you ruled out>

reasoning: <optional one sentence on why you chose this over the alternatives>

```

If that tool isn't available, this step is optional telemetry — proceed with your selection.

  1. If no section matches your job and a vois_report_pattern_gap tool is available, call it:

```

Tool: vois_report_pattern_gap

Arguments:

skillVersion: <this skill's version, from SKILL.md frontmatter>

userGoal: <what the UI needs to do>

attemptedFallback: <closest job ID from this skill, e.g. JOB-OVERLAY-INTERACTION>

reasoning: <what the rubrics don't cover>

```

There is no description/closestPathId/gapDescription argument shape on the real tool — use the fields above. If the tool isn't available, just note the gap in your own output and proceed with the closest match.

Note on workspace manifests. These rubrics use standard shadcn/ui component names. Your workspace may extend or rename them — e.g. Banner instead of Alert, DataTable instead of Table. Check your workspace manifest for the exact name; use the rubric logic to make the selection, then record the workspace-specific name.


Quick Reference

| Job | Use | Not |

|-----|-----|-----|

| Confirm destructive action | AlertDialog | Dialog, Toast |

| Fixed-length one-time code | InputOTP | Input |

| Transient feedback, no action needed | Toast | Alert, Banner |

| Transient feedback, action required | Alert (persistent) | Toast |

| Focused overlay, exactly one field anchored to a row/item | Popover | Sheet, Dialog |

| Focused overlay, short task | Dialog | Drawer, Sheet |

| Focused overlay, a handful of fields or more, contextual to a list item | Sheet | Dialog, Popover |

| Group content, interactive item | Card | div, Surface |

| Switch between major content areas | Tabs | Segmented Control |

| Filter a list, 2–4 options | Segmented Control | Tabs |

| Choose from short list | Select | Combobox |

| Choose from long list / search | Combobox | Select |

| Search + trigger actions | Command | Select, Combobox |

| Short label, no interaction | Tooltip | Popover |

| Rich content, triggered by click | Popover | Tooltip |

| Immediate-effect binary setting | Switch | Checkbox |

| Form field binary / consent | Checkbox | Switch |

| Page load or content fetch | Skeleton | Spinner |

| Action in progress | Spinner (inline) | Skeleton |

| Measurable long operation | Progress | Spinner |

| True zero state | EmptyState with CTA | Blank space |

| Filtered to zero results | Inline message + clear | EmptyState |

| Row-level actions | DropdownMenu | ContextMenu, Command |

| Icon-only action | IconButton (required label) | Button with an icon size and no name, a bare icon |

| A few related actions as one control | ButtonGroup | Separate Buttons with gaps, SegmentedControl |

| Pick one color from a fixed set | SwatchPicker | Select with colored dots, a hex input |

| Content taller than a fixed region (panel, menu, list) | ScrollArea | overflow: auto with the browser scrollbar |

| Right-click enhancement | ContextMenu | DropdownMenu |

| 2–5 sequential required steps, each fits a page container | Stepper (references/stepper.md) | Progress, Tabs, Wizard |

| 6+ steps, or a step that needs its own full page | Wizard | Stepper |

| 3+ levels deep, counting Home | Breadcrumb | Back link |

| 2 levels deep, counting Home | Back link | Breadcrumb |

| Simple collection, no sorting | List | Table |

| Comparable attributes, < 100 rows | Table | DataTable |

| One headline number | Stat tile in a Card (see vois-dataviz) | A one-bar chart |

| Trend, comparison, share, distribution | Chart: walk the vois-dataviz decision tree | A table of raw rows |

| 100+ rows, sortable, bulk actions | DataTable | Table |

| Open a record from a table row | Sheet (full page if the record is big) | Dialog |

| Table first load | Skeleton rows under real headers | Spinner |

| Persistent app navigation | Sidebar | Drawer |

| Contextual tools for selected item | Sheet or Panel | Sidebar, Drawer |

| Button opens a menu or navigates away | Button with trailing icon | Leading icon |

| Button with a familiar action symbol | Button with leading icon (approved list only) | Custom or unfamiliar icon |

| Button needs more input before it runs | Label ends with an ellipsis | Icon |


Icons in Labeled Buttons (extends Job 8, Trigger an action)

Default: no icon. A button with a clear label does not need one. Add an icon only when a rule below says so. Icon-only buttons are a different case (see Job 8). Icon size and stroke live in vois-tokens.

Walk these in order. Stop at the first yes.

  1. Does it open a menu or navigate away? Use a trailing icon. Chevron down for a menu, arrow for an external link. Example: Export with a chevron.
  2. Is its symbol on the approved list? Use a leading icon. Approved list: plus (create), download, upload, share, trash (delete), copy (duplicate), edit, search, filter. Add to this list in one place only. If the symbol is not on the list, do not add an icon.
  3. Otherwise: no icon. Example: Publish.

Rules that apply on top:

Related vois-tokens rules, not changed here: DS-ICON-001 (one stroke width), DS-ICON-002 (icon sizes) and DS-SURFACE-004 (less padding on the icon side of a text and icon button).


What You Must Supply

Radix and native elements give roles and keyboard behavior. These parts are the caller's job. The rules are in vois-tokens/references/accessibility.md.

| Component | You supply | Rule |

|-----------|------------|------|

| Tooltip | A focusable trigger. Nothing essential only in the tooltip. Not on a disabled control | DS-A11Y-029 |

| Select, Combobox, Command | A name from the visible label, not the chosen value | DS-A11Y-030 |

| Input, Textarea | aria-describedby to helper and error text, aria-invalid on failure | DS-A11Y-031 |

| Tabs | A text name per tab (aria-label if an icon). A name per tab list if there are several | DS-A11Y-032 |

| Table | A caption or name. <th> with scope | DS-A11Y-033 |

| Toast | A polite live region. No sole copy of a result or action | DS-A11Y-034 |

| Switch, Checkbox, Radio | A tied visible label. A switch label names the setting | DS-A11Y-035 |

| DropdownMenu, Popover | Radix, so Escape and focus return work | DS-A11Y-036 |

| Spinner, Skeleton | A text name in a live region, or aria-busy | DS-A11Y-037 |

| Icon Button, Dialog | aria-label (IconButton requires it as label, so it cannot be left out); a Dialog title | DS-A11Y-007, DS-A11Y-019 |


Lookalikes: Don't Hand-Build These

Agents often write markup that looks like a component but isn't one. A screen can follow every rule in this skill and still contain one. Before you write markup for any of these, use the component. If the project doesn't have one yet, check the registry (registry/registry.json) for a Vois version before reaching for stock shadcn: it ships the Button and IconButton, inputs, selectors, tabs, avatar, badge, tooltip, stepper and more (see its README). The full rows (why, rule IDs, evidence, a signal a script can match) are in data/components-rules.json under lookalikes.

Seen in blind builds (vois-eval/lookalike-pass, 40 builds):

| If you are about to write | Use instead |

|---|---|

| A raw <button> with your own focus ring, as a text link, an icon in an input, or a Tooltip or Popover trigger | Button: variant="link" for text, asChild as a trigger. For an icon, IconButton with its required label (the registry's vois-icon-button); inside a field, InputGroupButton (vois-tokens DS-ICON-006). No project Button yet? Install the registry's vois-button item |

| Loader2 with animate-spin | Spinner. No project Spinner yet? Install the registry's vois-spinner. Inside a Button, use the Button's loading prop |

| Buttons with role="radio" | RadioGroup (no project RadioGroup yet? Install the registry's vois-radio-group), or ToggleGroup (single) for a segmented control (the registry's vois-segmented-control) |

| Numbered circles joined by lines | The shared Stepper (references/stepper.md; the registry's vois-stepper is built to it) |

Not seen, but already forbidden by a rule:

| If you are about to write | Use instead |

|---|---|

| div or span with onClick | Button, or a link for navigation |

| fixed inset-0 backdrop and a centered box | Dialog, AlertDialog or Sheet |

| setTimeout that hides a message | Sonner toast |

| "x" or "×" text as a close | The Dialog or Sheet close, or a ghost icon Button with aria-label |

| window.confirm, alert or prompt | AlertDialog, or Sonner |

| A colored border-l-4 box with an icon and text | Alert with a status role |

| A round div or span holding an <img> or two capital letters as a person's picture | Avatar (no project Avatar yet? Install the registry's vois-avatar) |

| title="..." as a tooltip | Tooltip (no project Tooltip yet? Install the registry's vois-tooltip) |

When the prompt describes how something looks ("a red × in the corner", "a pill with a circle"), pick the component by its job, then style it. The look in a prompt is not the component.

Job Index

data/components-rules.json has the full decision tree (condition → recommended component, including nested thresholds and edge cases) plus every "why not X" rationale, for all 24 jobs — query it by id or number. This is now the only source for this content; the prose reference files it was extracted from have been removed as fully redundant.

Component specs: when a pick has no shadcn component and agents hand-build it, the spec lives in references/. Today that is references/stepper.md (the Stepper that JOB-MULTISTEP-GUIDE picks) and references/motion-morphs.md (the core eight: label and text morph, shared element transfer, number ticker and typed input, icon morph, directional transition, grow-from-trigger, reorder and regroup, status button), references/motion-tray.md (a tray and its lifecycle) and references/motion-context.md (shared element context, chart range change, collapse to indicator, small state changes). Pick the morph with vois-patterns/references/motion.md first.

Component names: data/component-names.json maps every component in the UI SDK behavior inventory to its canonical name, its shadcn/ui source and its Vois registry item, with a status (have, covered, build, compose, defer, skip). Use it to find the registry item for a name, or to see which components have no item yet.

Behavior cards (pilot): After you pick a component, read its card if one exists: behaviors/<id>.md for Tabs, Dialog, Combobox, Popover, Accordion, Toggle group, Alert dialog, Menubar, Pagination, Toast, Navigation menu, Calendar, Progress, Separator and InputOTP so far. A card lists how the component must behave (keyboard, focus, state, accessibility), each line with an ID like BHV-TABS-004 and a support tag. native means the library does it, so do not undo it. differs means the library does something else, so read the note. supply means you build it. decide means a product or design choice is open, so ask. unchecked means nobody has checked the library yet, so test it before you rely on it. If there is no card, the component has no written behavior rules yet, so say so and do not invent them. behaviors/<id>.json is the source and the .md is generated. node vois-components/scripts/behaviors.mjs checks them, and --write rebuilds the .md.

Source of truth: data/components-rules.json is canonical and, since the prose reference files were removed, the only source for decision-tree content. The Job Index table above is the one place each JOB-* ID is tagged in prose, and each JSON entry's source_file points here.

| Job ID | Job |

|---|---|

| JOB-CONFIRM-DESTRUCTIVE | Job 1 Confirm destructive action |

| JOB-TRANSIENT-FEEDBACK | Job 2 Transient feedback |

| JOB-OVERLAY-INTERACTION | Job 3 Focused overlay interaction |

| JOB-CONTAIN-CONTENT | Job 4 Contain a unit of content |

| JOB-SWITCH-VIEWS | Job 5 Switch views / filter |

| JOB-CHOOSE-FROM-LIST | Job 6 Choose from a list |

| JOB-CONTEXTUAL-INFO | Job 7 Contextual info (tooltip/popover) |

| JOB-TRIGGER-ACTION | Job 8 Trigger an action |

| JOB-ACCEPT-TEXT | Job 9 Accept text input |

| JOB-BINARY-PREFERENCE | Job 10 Binary preference |

| JOB-LABEL-CONTENT | Job 11 Label/categorize content |

| JOB-REPRESENT-USER | Job 12 Represent a user/group |

| JOB-LOADING-STATE | Job 13 Loading state |

| JOB-EMPTY-CONTENT | Job 14 Empty content |

| JOB-EXPOSE-ACTIONS | Job 15 Expose a set of actions |

| JOB-MULTISTEP-GUIDE | Job 16 Multi-step process |

| JOB-NAVIGATION-POSITION | Job 17 Position in a hierarchy |

| JOB-DISPLAY-DATA | Job 18 Display structured data |

| JOB-DATA-ENTRY | Job 19 Data entry surface |

| JOB-SECONDARY-CONTENT | Job 20 Secondary content / persistent nav |

| JOB-VISUALIZE-DATA | Job 21 Visualize data (hands the form choice to vois-dataviz) |

| JOB-ANSWER-CHOICE-QUESTION | Job 22 Answer a choice question (survey, one question per screen) |

| JOB-ANSWER-SCALE-OR-RANK | Job 23 Answer a scale or ranking question |

| JOB-SHOW-POLL-RESULTS | Job 24 Show how others answered a choice question |


Relationship to Other Skills

Read vois-patterns first. That skill determines the container type — settings page, form, table, dialog. Once you know the structure, come here to pick the specific components that fill it.

vois-dataviz for charts. JOB-VISUALIZE-DATA picks the container (Card, Tabs, filter row, states). The chart form, chart colors, honesty rules and dashboard structure come from vois-dataviz.

vois-fields for specialized inputs. JOB-ACCEPT-TEXT picks the component (Input, Textarea, InputOTP). For an email, phone, URL, postal code, name, VIN, driver's license, SSN, money, percent, date or one-time code value, a prefilled value or a record picker, vois-fields gives the input type, keyboard, autofill, check timing and privacy handling. A one-time code input must take a pasted or autofilled whole code.

Read vois-tokens after. Once components are selected, vois-tokens handles tokens, spacing, animation, and accessibility implementation.

Righter for all copy. Component labels, empty state messages, button text, error copy — all of it goes through righter (which calls vois_get_microcopy first when that tool is available). This skill says nothing about words.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.