ComboBox
Input with a filterable dropdown of options. Supports keyboard navigation (↑↓, Enter, Escape).
ComboBox
Design lines
vue
1<Tabs defaultValue="tuix">2 <TabsList>3 <Tab value="tuix">TUIX</Tab>4 <Tab value="rubik">Rubik</Tab>5 </TabsList>6 <TabPanel value="tuix">7 <ComboBox8 model-value="apple"9 placeholder="Type to search..."10 :items="[{ label: 'Apple', value: 'apple' }, { label: 'Banana', value: 'banana' }, { label: 'Cherry', value: 'cherry' }]"11 design="tuix"12 />13 </TabPanel>14 <TabPanel value="rubik">15 <ComboBox16 model-value="apple"17 placeholder="Type to search..."18 :items="[{ label: 'Apple', value: 'apple' }, { label: 'Banana', value: 'banana' }, { label: 'Cherry', value: 'cherry' }]"19 design="rubik"20 />21 </TabPanel>22</Tabs>Demo
Filtrado (items + modelValue)
Escribe para filtrar las opciones.
vue
1<ComboBox v-model="fruit" :items="fruits" placeholder="Type to search..." />Placeholder (placeholder)
Texto de ayuda cuando no hay valor.
vue
1<script setup lang="ts">2import { ref } from 'vue'3import { ComboBox } from '@dowardev/herdrate-vue'45const placeholderA = ref('')6const placeholderB = ref('')7</script>89<template>10 <ComboBox v-model="placeholderA" :items="fruits" placeholder="Search fruit..." />11 <ComboBox v-model="placeholderB" :items="fruits" placeholder="Select framework..." />12</template>Color (color)
Color del borde y del resaltado.
Every variant keeps its own state with an initial value: typing in one never affects the others.
vue
1<script setup lang="ts">2import { ref } from 'vue'3import { ComboBox } from '@dowardev/herdrate-vue'45const colorPrimary = ref('apple')6const colorSuccess = ref('apple')7</script>89<template>10 <ComboBox v-model="colorPrimary" :items="fruits" color="primary" placeholder="Primary" />11 <ComboBox v-model="colorSuccess" :items="fruits" color="success" placeholder="Success" />12</template>Deshabilitado (disabled)
Bloquea la interacción; el valor sigue visible.
vue
1<ComboBox v-model="fruitDisabled" :items="fruits" disabled placeholder="Disabled" />Events
| Event | Payload | Description |
|---|---|---|
update:modelValue | string | Emitted when an item is selected |
API
| Prop | Type | Default | Description |
|---|---|---|---|
items | Array<{label: string, value: string}> | [] | Dropdown options |
modelValue | string | '' | Selected value (v-model) |
color | 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark' | 'primary' | Focus and highlight color |
placeholder | string | 'Search...' | Input placeholder |
disabled | boolean | false | Disable interaction |
design | 'tuix' | 'rubik' | — (inherits from data-design) | Design line (or inherit from data-design). |
items — each option has this shape:
| Field | Type | Required | Description |
|---|---|---|---|
label | string | ✅ | Visible text |
value | string | ✅ | Internal value |
CSS Custom Properties
| Token | Default | Description |
|---|---|---|
--font-mono | "JetBrains Mono", ui-monospace, monospace | Monospace font stack for code-like content (key labels, log lines, chips). |
--accent | from theme (--ctp-latte-mauve / --ctp-mocha-mauve) | Accent color, mapped from the active semantic color. |
--bg | from theme (--ctp-latte-base / --ctp-mocha-base) | Base background of the surface. |
--bg-elevated | from theme (--ctp-latte-surface0 / --ctp-mocha-surface0) | Background of floating surfaces (modals, dropdowns, popovers). |
--border | from theme (--ctp-latte-surface0 / --ctp-mocha-surface0) | Outline and divider color for surfaces. |
--text | from theme (--ctp-latte-text / --ctp-mocha-text) | Primary text color used inside the component. |
--color-primary | from theme (--ctp-latte-mauve / --ctp-mocha-mauve) | Primary semantic color (mauve in Catppuccin). |
--color-secondary | from theme (--ctp-latte-lavender / --ctp-mocha-lavender) | Secondary semantic color (lavender in Catppuccin). |
--color-tertiary | from theme (--ctp-latte-blue / --ctp-mocha-blue) | Tertiary semantic color (blue in Catppuccin). |
--color-success | from theme (--ctp-latte-green / --ctp-mocha-green) | Success semantic color (green in Catppuccin). |
--color-warning | from theme (--ctp-latte-yellow / --ctp-mocha-yellow) | Warning semantic color (yellow in Catppuccin). |
--color-danger | from theme (--ctp-latte-red / --ctp-mocha-red) | Danger semantic color (red in Catppuccin). |
--color-light | from theme (--ctp-latte-surface1 / --ctp-mocha-rosewater) | Light semantic color (lighter contrast tone). |
--color-medium | from theme (--ctp-latte-overlay0 / --ctp-mocha-overlay2) | Medium semantic color (mid-tone). |
--color-dark | from theme (--ctp-latte-text / --ctp-mocha-subtext1) | Dark semantic color (high contrast text). |
Ver Theming para la convención completa.