Skip to main content

<ui-input>

A single-line input field supporting text, number, integer, and password types.

<ui-input id="username" type="text" placeholder="Enter name" value=""></ui-input>
<ui-input id="age" type="number" min="0" max="120" step="0.5" value="18"></ui-input>
<ui-input id="port" type="int" min="1" max="65535" step="1" value="8080"></ui-input>
<ui-input id="secret" type="password" placeholder="Enter password"></ui-input>
<ui-input id="search" type="text" live="true" placeholder="Search…"></ui-input>

Attributes

AttributeRequiredDescription
idyesElement identifier
typenotext (default), number, int, or password
placeholdernoGhost text for text and password inputs
valuenoInitial value
min / maxnoClamp range for number and int inputs
stepnoArrow-button increment for number and int inputs. Defaults to 1 for int; omit or 0 to hide arrows for number
liveno"true" to emit input-changed on every keystroke instead of only on Enter or focus loss. Defaults to "false"

Event

Emits input-changed on Enter or focus loss by default, or on every keystroke when live="true".