Input
Terminal-style text input, with support for textarea, password and readonly.
Input
Design lines
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 <Input model-value="demo" placeholder="Search…" design="tuix" />8 </TabPanel>9 <TabPanel value="rubik">10 <Input model-value="demo" placeholder="Search…" design="rubik" />11 </TabPanel>12</Tabs>Demo
Basic (modelValue / v-model)
Text, password and multiline inputs bound with v-model.
1<Input v-model="text" placeholder="Type something..." />23<Input v-model="password" type="password" placeholder="Password" />45<Input v-model="multiline" :rows="3" />Placeholder (placeholder)
Two inputs with different placeholder texts.
1<Input placeholder="Type something..." />2<Input placeholder="e.g. user@email.com" />Color (color)
Each input keeps its own state so typing in one never affects the others.
1<script setup lang="ts">2import { ref } from 'vue'3import { Input } from '@dowardev/herdrate-vue'45const colorPrimary = ref('')6const colorSuccess = ref('')7const colorDanger = ref('')8</script>910<template>11 <Input v-model="colorPrimary" color="primary" placeholder="Primary" />12 <Input v-model="colorSuccess" color="success" placeholder="Success" />13 <Input v-model="colorDanger" color="danger" placeholder="Danger" />14</template>Disabled (disabled)
An input that ignores interaction while disabled.
1<Input placeholder="Disabled" disabled />Read only (readonly)
A readonly input that shows its value but cannot be edited.
1<Input v-model="readonlyText" readonly />Type (type)
text and password inputs side by side.
1<Input v-model="typeText" type="text" placeholder="Text" />2<Input v-model="typePassword" type="password" placeholder="Password" />Rows (rows)
A textarea-like input with rows set to 4.
1<Input v-model="rowsText" :rows="4" />Props
modelValue
Current input value (string v-model).
| Type | Default | Required |
|---|---|---|
string | '' | ❌ |
placeholder
Temporary text inside the input while it is empty.
| Type | Default | Required |
|---|---|---|
string | '' | ❌ |
color
Focus and active border color of the input.
| Type | Default | Required |
|---|---|---|
'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark' | 'primary' | ❌ |
disabled
Disables interaction with the input.
| Type | Default | Required |
|---|---|---|
boolean | false | ❌ |
readonly
Read-only input, visible but not editable.
| Type | Default | Required |
|---|---|---|
boolean | false | ❌ |
type
Input type: text, password or number.
| Type | Default | Required |
|---|---|---|
'text' \| 'password' \| 'number' | 'text' | ❌ |
rows
Number of rows. When greater than 1 it behaves as a textarea.
| Type | Default | Required |
|---|---|---|
number | 1 | ❌ |
design
Design line (or inherit from data-design).
| Type | Default | Required |
|---|---|---|
'tuix' | 'rubik' | — (inherits from data-design) | ❌ |
Events
| Event | Payload | Description |
|---|---|---|
update:modelValue | string | Emitted when typing in the input |
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. |
--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. |
Ver Theming para la convención completa.