Skip to content

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 ​

EventPayloadDescription
update:modelValuestringEmitted when an item is selected

API ​

PropTypeDefaultDescription
itemsArray<{label: string, value: string}>[]Dropdown options
modelValuestring''Selected value (v-model)
color'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark''primary'Focus and highlight color
placeholderstring'Search...'Input placeholder
disabledbooleanfalseDisable interaction
design'tuix' | 'rubik'— (inherits from data-design)Design line (or inherit from data-design).

items — each option has this shape:

FieldTypeRequiredDescription
labelstring✅Visible text
valuestring✅Internal value

CSS Custom Properties ​

TokenDefaultDescription
--font-mono"JetBrains Mono", ui-monospace, monospaceMonospace font stack for code-like content (key labels, log lines, chips).
--accentfrom theme (--ctp-latte-mauve / --ctp-mocha-mauve)Accent color, mapped from the active semantic color.
--bgfrom theme (--ctp-latte-base / --ctp-mocha-base)Base background of the surface.
--bg-elevatedfrom theme (--ctp-latte-surface0 / --ctp-mocha-surface0)Background of floating surfaces (modals, dropdowns, popovers).
--borderfrom theme (--ctp-latte-surface0 / --ctp-mocha-surface0)Outline and divider color for surfaces.
--textfrom theme (--ctp-latte-text / --ctp-mocha-text)Primary text color used inside the component.
--color-primaryfrom theme (--ctp-latte-mauve / --ctp-mocha-mauve)Primary semantic color (mauve in Catppuccin).
--color-secondaryfrom theme (--ctp-latte-lavender / --ctp-mocha-lavender)Secondary semantic color (lavender in Catppuccin).
--color-tertiaryfrom theme (--ctp-latte-blue / --ctp-mocha-blue)Tertiary semantic color (blue in Catppuccin).
--color-successfrom theme (--ctp-latte-green / --ctp-mocha-green)Success semantic color (green in Catppuccin).
--color-warningfrom theme (--ctp-latte-yellow / --ctp-mocha-yellow)Warning semantic color (yellow in Catppuccin).
--color-dangerfrom theme (--ctp-latte-red / --ctp-mocha-red)Danger semantic color (red in Catppuccin).
--color-lightfrom theme (--ctp-latte-surface1 / --ctp-mocha-rosewater)Light semantic color (lighter contrast tone).
--color-mediumfrom theme (--ctp-latte-overlay0 / --ctp-mocha-overlay2)Medium semantic color (mid-tone).
--color-darkfrom theme (--ctp-latte-text / --ctp-mocha-subtext1)Dark semantic color (high contrast text).

Ver Theming para la convención completa.