Input โ
A single-line text input with sizes, color and visual variants, validation states, prefix/suffix slots and a clearable button. Toggle Vue / CSS to switch the live demo and source together.
Basic โ
Default text input with label, placeholder and helper text.
Vue SFC
Types โ
text, email, password, number, tel, url, date, time and search.
Vue SFC
Sizes โ
Small, medium and large.
Vue SFC
Variants โ
outlined, filled and underlined.
underlined focuses with a soft glow under the line rather than a ring around the field โ tune it with --mono-input-underline-glow (default 0 5px 6px -6px).
Vue SFC
Colors โ
All built-in color variants.
Vue SFC
States โ
Disabled, readonly and required.
Vue SFC
Validation โ
valid, invalid and warning states with messages.
Vue SFC
Prefix & suffix โ
Icon or text on either side of the native input.
Vue SFC
Clearable โ
Clear button shown when the value is non-empty.
Vue SFC
Event log โ
Live log of mno-input, mno-change and mno-clear events.
Vue SFC
Customized โ
Override per-element styling with the cssClass prop (Vue) or extra utility classes (CSS).
Vue SFC
Width & height โ
Set width, height, min-width, max-width, min-height or max-height โ each takes a CSS string ("260px", "80%") or a number (px). Fields are full width by default; set width to constrain.
Vue SFC
CSS Variables โ
Vue SFC
Every input is themed through --mono-input-* custom properties. Setting one on the element, on any wrapper/ancestor, or inline all work โ custom properties inherit, and they pierce the shadow-DOM boundary, so the same overrides apply to <mono-input> and the shadow build. The color prop sets the focus accent, but an explicit --mono-input-focus-color override always wins. To re-skin globally, set the underlying --theme-* tokens.
| Variable | Default | Controls |
|---|---|---|
--mono-input-focus-color | --theme-primary | Focus / hover border color (set by color) |
--mono-input-focus-rgb | primary rgb | Focus ring color (as r, g, b) |
--mono-input-underline-glow | 0 5px 6px -6px | Underlined focus glow geometry |
--mono-input-color | --theme-text | Field text color |
--mono-input-border-color | --theme-border | Field border color |
--mono-input-bg | --theme-surface | Field background |
--mono-input-placeholder | --theme-placeholder | Placeholder color |
--mono-input-shadow | 0 1px 2px โฆ | Field shadow |
--mono-input-radius-md | --theme-radius-md | Corner radius (also -sm / -lg) |
--mono-input-height-md | --theme-control-height-md (2.25rem) | Field height (one per step: -xs โฆ -xxl) |
--mono-input-valid | --theme-success | Valid-state color |
--mono-input-invalid | --theme-danger | Invalid-state color |
--mono-input-warning | --theme-warning | Warning-state color |
Types โ
Import
import { InputProps } from 'mono-helper'| Prop | Value | Default | Description |
|---|---|---|---|
type | 'number' | 'date' | 'time' | 'text' | 'email' | 'password' | 'tel' | 'url' | 'month' | 'week' | 'search' | โ | Native input type controlling the field's behavior and keyboard. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | โ | Visual size of the input field. |
color | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | โ | Theme color applied to focus, borders, and accents. |
variant | 'underlined' | 'outlined' | 'filled' | โ | Visual style of the field (outlined, filled, or underlined). |
placeholder | string | โ | Placeholder text shown when the field is empty. |
value | string | number | โ | Current input value. |
name | string | โ | Form field name submitted with the input. |
modelValue | string | โ | Two-way bound value for v-model-style usage. |
disabled | boolean | โ | Disables interaction and dims the field. |
readonly | boolean | โ | Makes the field read-only while still focusable. |
clearable | boolean | โ | Shows a clear button when the field has a value. |
required | boolean | โ | Marks the field as required and shows a required indicator. |
autofocus | boolean | โ | Focuses the field automatically on first render. |
label | string | โ | Label text displayed above the field. |
helperText | string | โ | Helper text shown below the field. |
validationState | 'warning' | 'default' | 'valid' | 'invalid' | โ | Explicit validation state for styling and messaging. |
validationMessage | string | โ | Validation message shown below the field. |
error | boolean | โ | Marks the field in an error state. |
errorMessage | string | โ | Error message shown below the field. |
success | boolean | โ | Marks the field in a success state. |
successMessage | string | โ | Success message shown below the field. |
ariaLabelText | string | โ | Accessible label for the input element. |
ariaLabel | string | โ | Shorter alias for the accessible label. |
minLength | number | โ | Minimum allowed input length. |
maxLength | number | โ | Maximum allowed input length. |
min | string | number | โ | Minimum value for numeric or date inputs. |
max | string | number | โ | Maximum value for numeric or date inputs. |
step | string | number | โ | Step increment for numeric or date inputs. |
pattern | string | โ | Validation pattern the value must match. |
autocomplete | string | โ | Native autocomplete hint for the field. |
inputmode | string | โ | Native inputmode hint for the on-screen keyboard. |
width | string | number | โ | Explicit sizing. Each accepts a CSS length string (`"320px"`, `"80%"`) or a number (interpreted as px). Use `width="100%"` for a full-width field. |
height | string | number | โ | โ |
minWidth | string | number | โ | โ |
maxWidth | string | number | โ | โ |
minHeight | string | number | โ | โ |
maxHeight | string | number | โ | โ |
cssClass | InputCssClass | โ | Per-part class overrides for internal elements. |
visible | boolean | โ | Whether the control is shown. Defaults to `true`. |
visibleType | 'invisible' | 'none' | โ | How it hides when `visible` is `false`. Defaults to `'none'`. |