Select
Terminal-style dropdown select.
Select
Design lines
Option B
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 <Select8 model-value="2"9 :options="[{ label: 'Option A', value: '1' }, { label: 'Option B', value: '2' }, { label: 'Option C', value: '3' }]"10 placeholder="Select an option..."11 design="tuix"12 />13 </TabPanel>14 <TabPanel value="rubik">15 <Select16 model-value="2"17 :options="[{ label: 'Option A', value: '1' }, { label: 'Option B', value: '2' }, { label: 'Option C', value: '3' }]"18 placeholder="Select an option..."19 design="rubik"20 />21 </TabPanel>22</Tabs>Demo
Valor seleccionado (modelValue / v-model)
Lee la selección con v-model.
vue
1<Select v-model="selected" :options="options" placeholder="Choose an option" />Placeholder (placeholder)
Texto cuando no hay selección.
vue
1<script setup lang="ts">2import { ref } from 'vue'3import { Select } from '@dowardev/herdrate-vue'45const placeholderA = ref('')6const placeholderB = ref('')7</script>89<template>10 <Select v-model="placeholderA" :options="options" placeholder="Select..." />11 <Select v-model="placeholderB" :options="options" placeholder="Choose a framework..." />12</template>Opciones (options)
Array de objetos { label, value }.
ts
1const options = [2 { label: 'Vue', value: 'vue' },3 { label: 'React', value: 'react' },4]vue
1<Select v-model="selected" :options="options" />Color (color)
Color del foco y borde al abrir.
Every variant keeps its own state with an initial value: opening one never affects the others.
vue
1<script setup lang="ts">2import { ref } from 'vue'3import { Select } from '@dowardev/herdrate-vue'45const colorPrimary = ref('1')6const colorSuccess = ref('1')7</script>89<template>10 <Select v-model="colorPrimary" :options="options" color="primary" placeholder="Primary" />11 <Select v-model="colorSuccess" :options="options" color="success" placeholder="Success" />12</template>Deshabilitado (disabled)
Bloquea la interacción; el valor sigue visible.
Option 2
vue
1<Select v-model="selectedDisabled" :options="options" disabled placeholder="Disabled" />Events
| Event | Payload | Description |
|---|---|---|
update:modelValue | string | Emitted when an option is selected |
API
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | string | '' | Selected value (v-model) |
options | Array<{label: string, value: string}> | [] | Dropdown options |
color | 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark' | 'primary' | Focus color |
disabled | boolean | false | Disabled |
placeholder | string | 'Select...' | Placeholder |
design | 'tuix' | 'rubik' | — (inherits from data-design) | Design line (or inherit from data-design). |
options — 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-alt | from theme (--ctp-latte-mantle / --ctp-mocha-mantle) | Alternate background (the next layer down from the base). |
--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. |
--text-muted | from theme (--ctp-latte-subtext1 / --ctp-mocha-subtext1) | Secondary text for hints, annotations and disabled state. |
--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). |
--cp-ease | cubic-bezier(.4, 0, .2, 1) | Default easing curve for transitions. |
--cp-ease-snap | cubic-bezier(.3, 1.4, .5, 1) | Snap easing (overshoots) for pop interactions. |
Ver Theming para la convención completa.