Input

Capture a single line of text with validation and state feedback.

Input

Default

class and style apply to the complete Input surface, so margins and widths move or size the wrapper and input together. Native attributes such as name, data-*, and aria-* remain on the underlying input.

Add an elements input facilitate with the component input

Placeholder animation

An ordinary placeholder dissolves when an empty input gains focus and reassembles when it loses focus. Entering a value hides it immediately so fragments cannot cover typed content. Each input animates independently; rapid focus changes reverse from the current progress. Reduced-motion mode switches states immediately. label-float retains its floating-label behavior.

Shape

Use shape="square" for straight corners. Shape is independent from border, shadow, color, state, and affix styling.

Clearable

Set allow-clear to show a clear button at the end while the input is hovered or focused. Pressing Escape also clears the current value.

Label

Add a label to the input with the property label

Label Float

You can have a placeholder with a great animation when being or in focus or with a value becoming a label above the input with the property label-float

Color

Change the color of the component and add a border below with the color property, the allowed values ​​are the main colors of Sax Design and the colors (RGB y HEX)

Icon

Add an icon to the input easily with the slot icon if you want the icon to be before the input you can do it with the property icon-before

Default icons

Sax Design Vue renders build-time Iconify SVG data. Built-in controls, such as close buttons in Alert or Popup, use SVG icons and require no external icon font. Use the #icon slot when a product needs another icon.

Find and use icons

Search Boxicons for a collection and copy its prefix:name value into SIcon.

Message

You can add a message below the input with the #message-{Sax Design color} to report that a field is missing or the value is wrong

State

Change the color of the input for some state, the allowed states are (primary, success, danger, warn, dark)

Progress

Add a validation progress bar, the most common is its use to validate passwords and correct data within the input, its value is (0 - 100).

The example validates that the password has at least

  • A special character
  • More than 6 digits
  • One lower case letter
  • An uppercase letter
  • A number

Loading

Add a loading animation to the input with the loading property, the property is a Boolean, so you can add it without any value.

Input types

Use type for text-oriented inputs: text, password, search, number, email, tel, or url. Date and time values use SDatePicker and STimePicker so formatting, themes, and popup behavior remain consistent.

Border - Shadow

input-style controls the surface: border uses an underline, shadow emphasizes the field with a shadow, and transparent removes the fill and shadow for embedding in another surface. These examples use matching sizes and neutral colors. Transparent icons also remain free of separate backgrounds and shadows.

Affixes

Add prefix and suffix icons with prefix-icon and suffix-icon. Use the matching slots when the affix needs fully custom content.

Sizes

Use size to render a small, default, or large input.

Set type="search" with controls to show the search action. Pressing Enter or clicking the action emits search-click.

Deferred commit

Set immediate="false" to synchronize v-model on change or blur. Type a value and click outside the field to see the committed value update.

Character count

Use max-length with show-word-count to limit and display the count. count-method customizes both behaviors; the second field counts UTF-8 bytes.

Native constraints

Common native constraints such as min, max, step, input-mode, pattern, and required are forwarded to the inner input. Number inputs also clamp typed and pasted values to the configured min–max range.

Format validation

email and url check native syntax on blur or form validation. tel has no regional phone rule; use pattern for your format. Empty values are allowed unless required is set. Typing is not filtered, and correcting the value clears the error. Standalone Input shows its own message; FormItem presents a single form message, prioritizing explicit Form rules. Use validation-message to customize native constraint errors. The phone pattern here is only an example. Input also exposes validate() (boolean) and clearValidate().

Autocomplete

Pass a string array or objects with value, label, description, and disabled to autocomplete. Suggestions match the value, label, and description without restricting free input. autocomplete-min-length controls when suggestions appear; autocomplete-limit caps the rendered list (default 20). Browser completion is disabled. Use ↑/↓ to navigate, Enter to fill, Escape to dismiss, and Tab to continue. Password and number inputs do not show suggestions. Selecting a suggestion commits the value even with immediate="false" and emits autocomplete-select.

API

PROPS

Property
Type
Values
Description
default
Example
More
autocomplete
[]
—
Component suggestions. String entries fill themselves; objects fill value and may provide label, description, and disabled. Legacy browser tokens are ignored.
—
autocomplete-limit
Number
—
Maximum number of suggestions rendered.
20
autocomplete-min-length
Number
—
Minimum input length before showing suggestions; zero also shows suggestions on focus.
0
block
Boolean
true | false
Stretch the input wrapper to the available width.
false
shape
String
rounded | square
Select rounded or square outer corners.
rounded
text-white
Boolean
true | false
Render the input text in white on a dark or colored surface.
false
allow-clear
Boolean
true | false
Show a trailing action that clears the current value.
false
clearable
Boolean
true | false
Compatibility alias for `allow-clear`.
false
disabled
Boolean
true | false
Disable editing and interaction.
false
wrap-classes
String
CSS class name
Add a custom class to the outer input wrapper.
—
wrap-styles
String | Object | Array
CSS style value
Add custom inline styles to the outer input wrapper.
—
v-model
String, Number
StringNumber
binding value
—
placeholder
String
String
placeholder of Input
—
label
String
String
a label above the component.
—
label-float
String
String
Add a placeholder converts to focus on a label.
—
color
String
primary | success | danger | warn | warning | dark | text | light | secondary | RGB | RGBA | HEX | HSL | HSLA
Change component color.
—
state
String
primary | success | danger | warn | warning | dark | text | light | secondary | RGB | RGBA | HEX | HSL | HSLA
Change the background color of the component by changing its status.
—
progress
Number
0 - 100
progress bar starting in red and ending in green.
—
loading
Boolean
Boolean
Show the shared trailing loader, preserve the value, and block editing, clearing, and popup interaction.
false
type
text | password | search | number | email | tel | url
Set a text-oriented input type. Use DatePicker or TimePicker for date and time values.
text
border
Boolean
Boolean
Change the style of the component.
false
shadow
Boolean
Boolean
Change the style of the component.
false
icon-after
Boolean
Boolean
suffix icon component
false
show-password
boolean
boolean
If the input is of the password type, it is modified to show the password.
false
max-length
Number | String
non-negative length
Limit the accepted input length.
—
show-word-count
Boolean
true | false
Show the current input count in the suffix area.
false
trim
Boolean
true | false
Trim leading and trailing whitespace when a change is committed.
false
count-method
({ value: string }) => number
A monotonic non-negative counter
Customize both the displayed count and max-length enforcement for bytes or another encoding.
value.length
size
String
small | medium | large
Set the input size.
medium
immediate
Boolean
true | false
Update while typing or commit the value on change and blur.
true
controls
Boolean
true | false
Show the built-in search or password action.
false
prefix-icon
String
icon name
Render an icon before the input content; the prefix slot takes priority.
—
suffix-icon
String
icon name
Render an icon after the input content; reserved actions remain available.
—
prefix-config
{ icon?content?status? }
Configure prefix icon, text, and semantic status.
—
suffix-config
{ icon?content?status? }
Configure suffix icon, text, and semantic status.
—
min-length
Number | String
non-negative length
Forward the native minimum input length.
—
min
Number | String
numeric boundary
Set the minimum value for number input and clamp committed values.
—
max
Number | String
numeric boundary
Set the maximum value for number input and clamp committed values.
—
step
Number | String
numeric step
Forward the native number input step.
—
input-mode
String
none | text | decimal | numeric | tel | search | email | url
Hint which virtual keyboard should be displayed.
—
validation-message
string
—
Override native format, required, and pattern validation messages. Form rule messages take precedence.
—
pattern
String
regular expression source
Forward the native validation pattern.
—
required
Boolean
true | false
Mark the native input as required.
—
multiple
Boolean
true | false
Forward the native multiple-value hint for supported input types.
—
readonly
Boolean
true | false
Set the native input to read-only.
false
editable
Boolean
true | false
Allow the input value to be edited.
true
auto-focus
Boolean
true | false
Focus the input after mounting.
false
align
String
left | center | right
Align the input text.
—

EVENTS

Event
Type
Description
default
Example
More
autocomplete-select
(option: ) => void
Fires with the selected option after its value is committed.
—
update:modelValue
String | Number
Fire while the bound input value changes.
—
—
input
String | Number
Fire while the bound input value changes.
—
—
change
String
Fire when the native change is committed or the configured lazy update is committed.
—
—
lazy-change
String
Fire when the native change is committed or the configured lazy update is committed.
—
—
focus
FocusEvent
Fire when the input gains or loses focus.
—
—
blur
FocusEvent
Fire when the input gains or loses focus.
—
—
clear
—
Fires after the clear action resets the value.
—
—
click
MouseEvent | Event
Fire for the input surface and its icon actions.
—
—
clickIcon
MouseEvent | Event
Fire for the input surface and its icon actions.
—
—
prefix-click
MouseEvent | Event
Fire for the input surface and its icon actions.
—
—
suffix-click
MouseEvent | Event
Fire for the input surface and its icon actions.
—
—
keydown
KeyboardEvent | WheelEvent
Forward keyboard and wheel interaction events.
—
—
keyup
KeyboardEvent | WheelEvent
Forward keyboard and wheel interaction events.
—
—
wheel
KeyboardEvent | WheelEvent
Forward keyboard and wheel interaction events.
—
—
mouseenter
MouseEvent
Fire when the pointer enters or leaves the input wrapper.
—
—
mouseleave
MouseEvent
Fire when the pointer enters or leaves the input wrapper.
—
—
search-click
(value: String, event: KeyboardEvent | MouseEvent)
Fires when search is submitted from the icon or keyboard.
—
—
toggle-visible
Boolean
Fires when password visibility changes.
—
—

SLOTS

Slot
Scope
Description
default
Example
More
autocomplete-option
Customize suggestion content. Keep the option selection and keyboard interaction provided by Input.
—
icon
null
Add an icon to the input.
—
message
message-successmessage-dangermessage-warn
Add an informative text below the input.
—
prefix
—
Customize either affix. The suffix slot replaces the default counter and receives its current count and limit.
—
suffix
{ count: number; limit: number | undefined }
Customize either affix. The suffix slot replaces the default counter and receives its current count and limit.
—

EXPOSES

Method
Type
Description
default
Example
More
validate
() => boolean
Check native input constraints, update the error state, and return validity.
—
clearValidate
() => void
Clear this Input validation state without changing its value. Use Form.clearValidate for form errors.
—
Last Updated: 2026-10-28, 06:17:56 UTC
Copied