Component design spec

From FerroxLabs/murage · View interactive version

Component design spec is an AI agent skill from the GitHub repository FerroxLabs/murage. Produces a complete UI component specification with states, props, accessibility requirements, and usage guidelines as a tool-agnostic design artifact. Use when the user asks to spec out a UI component, define component states and variants, document a design component, or create component design req

How to use this skill

Skill file

Component Design Spec

When to Use

Use this skill when:

Do NOT use when:


Process

Step 1: Identify and Classify the Component

Before writing a single spec line, establish exactly what kind of component is being designed. The type of component determines which sections, states, and ARIA patterns apply.

Step 2: Define the Anatomy

A component anatomy breaks the component into named, documented parts. This is the shared vocabulary between designers and engineers.

Step 3: Define Variants and Their Decision Rules

Variants are not just visual options -- each variant must have a specific, unambiguous use case that tells the designer or engineer which one to choose.

Step 4: Define All States

States are one of the most under-documented aspects of component specs. Every interactive component must have a complete state inventory.

Step 5: Define Props

Props are the API surface of the component. A well-defined prop table is the contract between design and engineering.

Step 6: Define Accessibility Requirements

Accessibility is a first-class requirement, not a post-hoc addition. This section specifies the full accessibility contract.

Step 7: Define Usage Guidelines and Composition Rules

Usage guidelines prevent the component from being misused after it ships.

Step 8: Compile and Quality-Check the Specification

Before delivering the spec, run through this quality checklist:


Output Format

## Component Spec: [Component Name]

**Classification:** [Atom / Molecule / Organism] | [Form Control / Triggering / Overlay / Navigation / Feedback / Display]
**ARIA Pattern:** [APG pattern reference, e.g., "Button Pattern", "Combobox Pattern", "Dialog (Modal) Pattern"]
**Scope:** [List of variants, sizes, modes, RTL support, theming as determined in Step 1]

---

### Purpose
[One sentence describing what this component does and the specific user need it addresses. Format: "The [Component Name] [verb describing action] so that [user outcome]."]

---

### Anatomy
| Part              | CSS / Slot Name         | Description                                        | Required | Overflow Behavior              |
|-------------------|-------------------------|----------------------------------------------------|----------|-------------------------------|
| [Part Name]       | [class or slot name]    | [What this part is and what it displays]           | Yes / No | [truncate at Npx / wrap / N lines max / none] |

**Spatial relationship:** [ASCII diagram or prose describing how parts are positioned relative to each other]

---

### Variants

#### Visual Variants
| Variant    | Background        | Border                  | Text Color        | Use Case (one sentence, unambiguous)                |
|------------|-------------------|-------------------------|-------------------|-----------------------------------------------------|
| [name]     | [token]           | [token or "none"]       | [token]           | [exact scenario when this variant is correct]       |

#### Functional / Intent Variants (if applicable)
| Intent     | Icon              | Color Override          | ARIA              | Use Case                                            |
|------------|-------------------|-------------------------|-------------------|-----------------------------------------------------|
| [name]     | [icon name]       | [token]                 | [aria-live value] | [exact scenario]                                    |

#### Size Variants
| Size | Height | Horizontal Padding | Vertical Padding | Font Size | Icon Size | Min Width | Use Context                              |
|------|--------|--------------------|------------------|-----------|-----------|-----------|------------------------------------------|
| xs   | [px]   | [px]               | [px]             | [px]      | [px]      | [px]      | [when to use this size]                  |
| sm   | [px]   | [px]               | [px]             | [px]      | [px]      | [px]      | [when to use this size]                  |
| md   | [px]   | [px]               | [px]             | [px]      | [px]      | [px]      | [when to use this size -- the default]   |
| lg   | [px]   | [px]               | [px]             | [px]      | [px]      | [px]      | [when to use this size]                  |

#### Valid Variant Combinations Matrix
| Visual Variant | sm | md | lg | Destructive | Loading | Disabled |
|----------------|----|----|----|-------------|---------|----------|
| Primary        | ✓  | ✓  | ✓  | ✓           | ✓       | ✓        |
| Secondary      | ✓  | ✓  | ✓  | ✓           | ✓       | ✓        |
| Ghost          | ✓  | ✓  | ✓  | ✗ (note)    | ✓       | ✓        |

[Note: explain any ✗ combinations]

---

### States

**[Variant Name] States** (repeat table per variant group, or note deltas)

| State        | Background     | Border              | Text Color     | Icon Color     | Opacity | Cursor       | Additional Visual Indicator       |
|--------------|----------------|---------------------|----------------|----------------|---------|--------------|-----------------------------------|
| default      | [token]        | [token or "none"]   | [token]        | [token]        | 1       | pointer      | --                                |
| hover        | [token]        | [token or "none"]   | [token]        | [token]        | 1       | pointer      | [e.g., box-shadow change]         |
| focus        | [token]        | [token or "none"]   | [token]        | [token]        | 1       | pointer      | 2px solid [token], 2px offset     |
| active       | [token]        | [token or "none"]   | [token]        | [token]        | 1       | pointer      | [e.g., translate-y: 1px]         |
| disabled     | [token]        | [token or "none"]   | [token]        | [token]        | 0.5     | not-allowed  | pointer-events: none              |
| loading      | [token]        | [token or "none"]   | transparent    | transparent    | 0.8     | wait         | Spinner overlaid at center, 16px  |
| error        | [token]        | 2px solid [token]   | [token]        | [token]        | 1       | pointer      | Error icon at leading position    |
| selected     | [token]        | [token or "none"]   | [token]        | [token]        | 1       | pointer      | [e.g., checkmark icon appears]    |
| read-only    | [token]        | 1px dashed [token]  | [token]        | [token]        | 1       | default      | No hover state applies            |

**State Transitions:**
| From State | To State  | Trigger                 | Transition                              |
|------------|-----------|-------------------------|-----------------------------------------|
| default    | hover     | mouseenter              | background 150ms ease                   |
| default    | focus     | Tab / programmatic      | outline appears immediately (no delay)  |
| default    | loading   | onClick                 | label fades out 100ms, spinner fades in |
| loading    | default   | async resolve           | spinner fades out 100ms, label fades in |
| loading    | error     | async rejection         | border color change 200ms ease          |

---

### Props
| Prop           | Type              | Default       | Valid Options                          | Mutually Exclusive With | Description                                      |
|----------------|-------------------|---------------|----------------------------------------|-------------------------|--------------------------------------------------|
| [propName]     | [type]            | [default]     | [options for enum / range for number]  | [propName or "none"]    | [what it controls -- behavioral description]     |

**Priority rules for conflicting props:**
- [e.g., "When both isLoading and isDisabled are true, isLoading takes visual precedence. The disabled behavior (no click handler) still applies."]

---

### Accessibility

- **ARIA Role:** [role, with note on whether native HTML element provides it or role attribute is needed]
- **Required ARIA Attributes:**
  - `[attribute]`: [when required and what value it takes]
- **Conditional ARIA Attributes:**
  - `[attribute]`: [what triggers it and what value it takes]
- **Keyboard Interaction:**
  | Key             | Action                                                       |
  |-----------------|--------------------------------------------------------------|
  | Tab             | [behavior]                                                   |
  | Shift+Tab       | [behavior]                                                   |
  | Enter           | [behavior]                                                   |
  | Space           | [behavior]                                                   |
  | Escape          | [behavior or "not applicable"]                               |
  | Arrow keys      | [behavior or "not applicable"]                               |
- **Screen Reader Announcement:**
  - On focus: "[exact announcement text or template, e.g., '{label}, button']"
  - On activation: "[what is announced, e.g., 'Loading, please wait' if loading state begins]"
  - On state change: "[e.g., 'Expanded' when aria-expanded changes to true]"
  - On error: "[e.g., Error message announced via aria-live='polite' region]"
- **Focus Management:**
  - [Where focus is before interaction]
  - [Where focus moves on activation]
  - [Where focus returns on close/dismiss, if applicable]
- **Touch Target:** Minimum [N]x[N]px tap target. If visual size is smaller, extend the interactive area using padding or pseudo-element overlay.
- **Reduced Motion:** [Which animations collapse to instant; which transition to a simpler alternative]
- **Contrast Requirements:**
  | Element          | Foreground Token | Background Token | Required Ratio | Pass/Verify     |
  |------------------|------------------|------------------|----------------|-----------------|
  | Label text       | [token]          | [token]          | 4.5:1          | Verify at build |
  | Border (default) | [token]          | [token]          | 3:1            | Verify at build |
  | Focus ring       | [token]          | [token]          | 3:1            | Verify at build |

---

### Usage Guidelines

**Use when:**
- [Specific, unambiguous scenario 1]
- [Specific, unambiguous scenario 2]

**Do NOT use when:**
- [Anti-pattern 1] -- use [alternative component] instead
- [Anti-pattern 2] -- use [alternative component] instead

**Content Guidelines:**
- Label text: [case convention, max character count, verb-first / noun-first rule]
- Helper text: [max length, tone, punctuation]
- Error messages: [tone, actionability requirement -- must tell user what to do, not just that an error occurred]
- Placeholder text: [rules -- do not use as substitute for label]

**Composition Rules:**
- MAY be placed inside: [list of parent components / layout containers]
- MUST NOT be placed inside: [list of forbidden parent contexts]
- MAY contain: [allowed child elements]
- MUST NOT contain: [forbidden child content]
- When adjacent to [Component X]: [spacing / alignment rule]

**Theming:**
- Light mode: [which tokens apply]
- Dark mode: [which tokens change and to what]
- High-contrast mode: [any overrides needed for Windows High Contrast / forced-colors media query]

Rules

  1. Never suppress the focus ring. The focus state must be visible and must meet 3:1 contrast against its adjacent background. Using outline: none without a replacement focus indicator is a WCAG 2.1 failure (SC 1.4.11, 2.4.7). The acceptable pattern is :focus-visible with a clearly defined replacement outline.
  1. Never mark accessibility as optional. Every component spec MUST include ARIA role, keyboard interaction table, screen reader announcement text, and focus management rules. "TBD" in the accessibility section is not acceptable -- if the information is unknown, the spec is incomplete.
  1. Disabled state must be implemented with both visual muting AND cursor change. Opacity must be reduced (0.4--0.6 range) OR background/text colors must shift to neutral tokens. Cursor must be not-allowed. The pointer-events: none CSS rule alone is insufficient -- it does not communicate the disabled state to keyboard or screen reader users.
  1. Distinguish disabled from read-only. Disabled removes the element from tab order and announces it as unavailable. Read-only keeps it in tab order, announces its value, and uses a default cursor. Conflating them causes both keyboard traps and missing information for screen reader users.
  1. Every prop must have an explicit default value -- never "none" or "N/A". If a prop is optional and has no meaningful default, the default is undefined or null, and you must document what the component renders when the prop is omitted. Undocumented defaults create inconsistent implementations across teams.
  1. Document invalid variant combinations explicitly. A Ghost Destructive button reduces the urgency of a dangerous action. A Loading Disabled button creates contradictory semantics. Each invalid combination must be listed with a rationale so engineers can add validation and designers can avoid the combination.
  1. Specify exact token names, not hex values. Component specs must reference design token names (e.g., color-action-primary, color-text-inverse) -- never raw hex codes or CSS named colors. This ensures the spec stays valid when tokens are updated and works across themes.
  1. Text overflow behavior is mandatory for every part that displays text. Every text element needs: maximum character count OR maximum container width with an overflow rule (truncate with ellipsis, wrap to N lines, scroll). "It wraps" is not a complete overflow rule.
  1. State transitions must include timing values. "The background changes on hover" is incomplete. The correct form is "background transitions over 150ms ease-in-out." This prevents engineers from using inconsistent durations and ensures the motion system is coherent. For prefers-reduced-motion, all decorative transitions collapse to transition: none.
  1. The loading state must preserve the component's dimensions. When a Button enters loading state, its width must not change -- the spinner replaces the label visually but the container holds its size. Layout shift during state changes is a UX failure and may fail WCAG 2.5.3 (Label in Name) if the label disappears.
  1. Compound components require a parent-child relationship table. If the component is a composite widget (Tabs, Accordion, Menu, Select, Combobox), each sub-component must be specced, and the required DOM nesting order must be documented. ARIA roles for composite widgets have strict parent-child requirements -- for example, tab elements must be owned by a tablist.
  1. Usage guidelines must contain at least one documented anti-pattern per variant. Listing only correct usage is insufficient. Real anti-patterns (e.g., using a Primary Button for navigation, using an Alert for promotional content, using a Tooltip on a disabled element) must be named explicitly to prevent recurring misuse.

Edge Cases

Compound Components (Tabs, Accordion, Combobox, Menu, RadioGroup)

Spec each sub-component in its own anatomy and states section. Then add a "Composition Structure" section documenting the required nesting order, owner-owned ARIA relationships, and data flow. For Tabs: tablist owns tab elements; each tab controls a tabpanel via aria-controls; each tabpanel is labelled by its tab via aria-labelledby. Arrow key navigation moves between tabs (not Tab key) -- this is a roving tabindex pattern, where only the active tab is in the tab sequence. Document this explicitly because engineers frequently implement it incorrectly.

Overlay Components (Modal, Drawer, Tooltip, Popover, Dropdown Menu)

These require three additional sections beyond standard state tables: (1) Positioning rules -- how the overlay positions relative to its trigger (above, below, start, end), collision detection behavior when near viewport edges (flip vs. shift vs. clip), and offset distance from the trigger (typically 4--8px). (2) Focus trap rules -- Modals and Dialogs require focus to be trapped inside using a focus trap pattern (Tab cycles through all focusable elements inside; Shift+Tab cycles in reverse; focus does not leave the dialog). Popovers and Tooltips do NOT trap focus. (3) Dismiss rules -- clicking the backdrop closes modals; Escape closes all overlays; clicking outside a popover closes it; Tooltips close on mouseleave and blur. Z-index layering must be documented to prevent stacking conflicts (typical values: Tooltip at 1100, Modal at 1300, Toast at 1400).

Components With Async States (Form Submit Button, Data Table, Search Input)

Define the complete state lifecycle as a directed graph: idle → loading → success | error → idle. Each transition must have a defined trigger (user action or system event), a defined duration rule (minimum 300ms display time for loading state to prevent flash-of-loading; this threshold prevents the spinner from flashing for fast network responses), and a defined UI change. Error states must be specific -- a generic "something went wrong" error fails WCAG SC 3.3.1 (Error Identification), which requires that errors be described in text. Specify the error message format and where it appears relative to the component.

Components That Must Support Right-to-Left (RTL) Layout

Mirror the horizontal anatomy: leading icon becomes trailing icon, leading padding becomes trailing padding. Use logical CSS properties (padding-inline-start, margin-inline-end, text-align: start) instead of physical properties (padding-left, margin-right, text-align: left) in all dimensional specs. For directional icons (chevrons, arrows, play buttons), specify whether they flip in RTL or remain unchanged. Progress bars always fill left-to-right in LTR and right-to-left in RTL. Document the mirroring rule for each part individually rather than assuming a global flip applies correctly.

Components With Dynamic Content (Data Table, List, Virtualized Scroll)

When a component renders variable amounts of data, specify: (1) the empty state (what renders when there is no data -- never a blank space; always a defined empty state with a message and optional action), (2) the loading state (skeleton rows vs. spinner overlay vs. progressive loading), (3) the error state (inline error with retry action), and (4) the maximum density threshold (e.g., a Data Table row height should not go below 40px in compact mode to maintain legibility and touch targets). For virtualized lists, document which ARIA attributes are required (aria-setsize, aria-posinset on each item) to communicate the total list size to screen readers even when items are not rendered in the DOM.

Icon-Only Components (Icon Button, FAB, Close Button)

When a component has no visible text label, aria-label is mandatory -- not optional. The spec must specify the exact label string format for every variant. "Close" for a close button, "Open navigation menu" for a hamburger button, "Add new item" for an add FAB. The visual icon alone does not satisfy WCAG SC 1.1.1 (Non-text Content). Additionally, the minimum touch target must be explicitly enforced at 44x44px even if the visible icon is 24x24px -- specify the padding or pseudo-element technique used to extend the tap target without expanding the visual size.

Components With Many States That Interact (Form Input with Validation)

A text Input can simultaneously be focused AND in error state, or focused AND read-only, or disabled AND prefilled. Document state combinations as a priority order: disabled > read-only > error > loading > focused > hover > default. When two states apply simultaneously, the higher-priority state's visual properties win for conflicting attributes, but both states' ARIA attributes must be present (e.g., a focused error input shows both the focus ring AND the error border, with aria-invalid="true" AND :focus-visible styling both active).

Dark Mode and High-Contrast Mode

Do not create a separate spec for dark mode -- add a token delta table showing which tokens change between modes. The component structure is identical; only the token assignments change. For Windows High Contrast / forced-colors media query, CSS custom properties are overridden by the system. Specify which parts need forced-colors: active overrides to preserve meaningful visual differentiation (focus rings, disabled states, interactive boundaries). A border that is defined only by color (e.g., a ghost button with no background but a transparent border) becomes invisible in forced-colors mode and must have a ButtonBorder or Highlight system color fallback specified.


Example

Input: "Spec out a Combobox component for our design system. It should support single selection, have a filterable dropdown list, and work with keyboard navigation."

Output:

Component Spec: Combobox

Classification: Molecule | Form Control

ARIA Pattern: WAI-ARIA APG Combobox Pattern (List autocomplete with manual selection)

Scope: Single selection only; filterable input; dropdown list; sm / md / lg sizes; light and dark mode; no RTL in v1.


Purpose

The Combobox allows a user to select a single value from a predefined list by typing to filter visible options, so that users can efficiently find and select from large option sets without scrolling through every item.


Anatomy

| Part | CSS / Slot Name | Description | Required | Overflow Behavior |

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

| Wrapper | .combobox | Outer container scoping layout and positioning context for the listbox | Yes | Fixed width (consumer sets width) |

| Input | .combobox__input | Text input where user types to filter; displays selected value at rest | Yes | Truncate selected value with ellipsis |

| Chevron button | .combobox__toggle | Icon button (chevron-down) that opens/closes the listbox | Yes | Fixed 40px wide; icon rotates on open |

| Clear button | .combobox__clear | Icon button (x) to clear the selected value; visible only when value set | No | Fixed 32px wide |

| Listbox | .combobox__listbox | Dropdown panel containing filtered options | Yes | Max-height 280px; overflow-y: scroll |

| Option | .combobox__option | Selectable row in the listbox | Yes | Truncate at container width with ellipsis|

| Option group label | .combobox__group | Non-interactive section label for grouped options | No | Truncate at container width |

| No-results message | .combobox__empty | Shown when filter input matches no options | Yes | Single line, 14px, color-text-subtle |

| Helper text | .combobox__helper | Descriptive text below the wrapper | No | Wrap, max 2 lines |

| Validation message | .combobox__error | Error message below the wrapper, replaces helper text | No | Wrap, max 2 lines |

Spatial relationship:

┌─────────────────────────────────────────┐
│ [Input field..................] [x] [▾] │  ← Wrapper (flex row)
└─────────────────────────────────────────┘
  Helper text or validation message         ← Below wrapper

When open:
┌─────────────────────────────────────────┐
│ [Input field..................] [x] [▾] │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ Group Label (if grouped)                │  ← Listbox (absolute positioned)
│ ● Option 1                              │
│   Option 2                              │
│   Option 3                              │
│ ...                                     │
└─────────────────────────────────────────┘
  ↑ 4px gap between wrapper bottom and listbox top

Variants

Visual Variants

| Variant | Background | Border | Text Color | Use Case |

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

| Default | color-surface | 1px solid color-border | color-text-primary | Standard form fields in all contexts |

| Filled | color-surface-raised | none | color-text-primary | Fields embedded in surfaces with their own border (sidebars, cards)|

Functional / Intent Variants

| Intent | Icon | Color Override | ARIA | Use Case |

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

| Error | icon-alert-circle | color-border-error | aria-invalid="true" | Validation failure after submit or on-blur |

| Success | icon-check-circle | color-border-success | aria-invalid="false" | Confirmed valid selection (used sparingly) |

| Disabled | -- | color-surface-disabled | aria-disabled="true" | Field is not interactive in current context |

Size Variants

| Size | Height | Horizontal Padding | Vertical Padding | Font Size | Icon Size | Min Width | Use Context |

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

| sm | 32px | 10px | 5px | 13px | 16px | 120px | Dense forms, filter toolbars, data table inline editors |

| md | 40px | 12px | 9px | 14px | 20px | 160px | Default form context (standard page forms) |

| lg | 48px | 14px | 12px | 16px | 24px | 200px | High-prominence forms, onboarding, mobile-first layouts |

Valid Variant Combinations Matrix

| Visual Variant | sm | md | lg | Error | Success | Disabled |

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

| Default | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |

| Filled | ✓ | ✓ | ✓ | ✓ | ✗ (note)| ✓ |

Note: Filled + Success is invalid because the filled variant is used in surfaces where success states add visual noise. Use the default variant if validation feedback is required.


States

Input Wrapper States (Default Variant, md Size)

| State | Background | Border | Text Color | Opacity | Cursor | Additional Visual |

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

| default | color-surface | 1px solid color-border | color-text-primary | 1 | text | Chevron: color-icon-subtle |

| hover | color-surface | 1px solid color-border-hover | color-text-primary | 1 | text | Chevron: color-icon-default |

| focus | color-surface | 1px solid color-border-focus | color-text-primary | 1 | text | 2px solid color-focus-ring, 2px offset |

| open | color-surface | 1px solid color-border-focus | color-text-primary | 1 | text | Chevron rotates 180deg, listbox appears |

| disabled | color-surface-disabled | 1px solid color-border-disabled | color-text-disabled | 0.5 | not-allowed | Clear and chevron buttons also disabled |

| error | color-surface | 1px solid color-border-error | color-text-primary | 1 | text | Error icon at trailing position of input |

| read-only | color-surface-subtle | 1px dashed color-border | color-text-primary | 1 | default | No hover/focus border change |

Option States (within Listbox)

| State | Background | Text Color | Cursor | Additional Visual |

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

| default | transparent | color-text-primary | pointer | -- |

| hover | color-surface-hover | color-text-primary | pointer | -- |

| keyboard focus| color-surface-hover | color-text-primary | pointer | 2px inset focus ring color-focus-ring |

| selected | color-surface-selected | color-action-primary | pointer | Checkmark icon (16px) at leading position |

| selected+focus| color-surface-selected | color-action-primary | pointer | Both checkmark and focus ring visible |

| disabled | transparent | color-text-disabled | not-allowed | No hover state; skip in keyboard navigation |

State Transitions:

| From State | To State | Trigger | Transition |

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

| default | open | click input, click chevron, Alt+Down | listbox: opacity 0→1 over 150ms ease-out |

| open | default | Escape, click outside, select option | listbox: opacity 1→0 over 100ms ease-in |

| default | error | form submit with no value, blur | border: color transition 150ms ease |

| loading | open | options fetch resolve (min 300ms) | skeleton rows replaced by real options |


Props

| Prop | Type | Default | Valid Options / Range | Mutually Exclusive With | Description |

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

| value | string | undefined | Any string matching an option value | none | Controlled selected value |

| defaultValue | string | undefined | Any string matching an option value | value | Uncontrolled initial value |

| options | Option[] | [] | { value: string, label: string, disabled?: boolean, group?: string }[] | none | List of selectable options |

| placeholder | string | "Select..." | Any string, max 40 characters | none | Displayed in input when no value selected |

| isDisabled | boolean | false | -- | isReadOnly | Removes all interactivity |

| isReadOnly | boolean | false | -- | isDisabled | Keeps value visible but prevents changes; stays in tab order |

| isLoading | boolean | false | -- | isDisabled | Shows skeleton rows in listbox instead of options |

| isInvalid | boolean | false | -- | none | Applies error visual state |

| errorMessage | string | undefined | Any string | none | Error text below field; only renders when isInvalid=true |

| helperText | string | undefined | Any string | errorMessage | Descriptive text below field; hidden when errorMessage present |

| label | string | undefined | Any string (required if no aria-label) | none | Visible label above field |

| size | enum | "md" | "sm", "md", "lg" | none | Controls component density |

| variant | enum | "default" | "default", "filled" | none | Visual style |

| isClearable | boolean | false | -- | isDisabled | Shows the clear button when a value is selected |

| filterFunction | function | built-in | (option: Option, inputValue: string) => boolean | none | Custom filter logic; defaults to case-insensitive substring match |

| onValueChange | function | undefined | (value: string) => void | none | Called when selection changes |

| onInputChange | function | undefined | (inputValue: string) => void | none | Called on every keystroke in the input |

| onOpenChange | function | undefined | (isOpen: boolean) => void | none | Called when listbox opens or closes |

Priority rules for conflicting props:


Accessibility

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.