This will be publicly displayed.
Username is required.
<x-input wire:model="username" label="Username" description="This will be publicly displayed." />
<x-field> <x-label>Username</x-label> <x-description>This will be publicly displayed.</x-description> <x-input wire:model="username" /> <x-error name="username" /></x-field>
variant
prop to change the visual style of the input. The default value is
outline
.
<x-input type="text" variant="outline" /><x-input type="text" variant="filled" />
size
prop to make the input's height more compact. The default value is
base
.
<x-input size="base" placeholder="Filter by..." /><x-input size="sm" placeholder="Filter by..." />
badge
and
badge-color
props.
If the input is
required
it will automatically add a required badge.
<x-input type="email" label="Email" required /><x-input type="email" label="Email" required badge="Not Optional" badge-color="red" />
text
,
email
,
password
,
date
,
file
, etc.
The default value is
text
.
<x-input type="text" label="Text" /><x-input type="email" label="Email" /><x-input type="password" label="Password" /><x-input type="date" max="2999-12-31" label="Date" /><x-input type="file" label="File" />
<x-input disabled type="file" label="File" />
<x-input readonly variant="filled" />
<x-input label="Phone" x-mask="(+99) 999-9999-9999" /><x-input label="Date of Birth" x-mask="99/99/9999" placeholder="MM/DD/YYYY" /><x-input label="Credit Card" x-mask:dynamic="$input.startsWith('34') || $input.startsWith('37')? '9999 999999 99999' : '9999 9999 9999 9999'" />
o-...
or
s-...
for inputs. More information visit
icon
component.
<x-input icon="o-magnifying-glass" placeholder="Search orders" /><x-input icon-trailing="s-credit-card" placeholder="4444-4444-4444-4444" />
icon
or
iconLeading
and
iconTrailing
slot.
<x-input placeholder="Search orders"> <x-slot:iconTrailing> <x-button size="sm" variant="subtle" icon="o-x-mark" class="mr-2" /> </x-slot></x-input> <x-input size="sm" placeholder="Search orders"> <x-slot:iconTrailing> <x-button size="sm" variant="subtle" icon="o-x-mark" class="!h-6 mr-2" /> </x-slot></x-input>
clearable
for clearing contents,
copyable
for copying contents, and
viewable
for toggling password visibility. It use
iconTrailing
slot, so if
use this actionable props, you can't use
icon-trailing
props.
<x-input icon="o-magnifying-glass" placeholder="Search something" clearable /><x-input icon="o-key" readonly copyable /><x-input type="password" icon="o-finger-print" viewable />
Shortcuts for actions, it can be used when the input is focused.
Clearable : Alt + X , Copyable : Alt + C , Viewable : Alt + V .