Input

x-input

A text input with an optional label and automatic validation error display for Livewire and request errors.

php artisan components:add input

Examples

Basic

Text inputs with a label above the field.

<div class="grid w-full max-w-md justify-center gap-4">
    <x-components.input label="Email address" type="email" placeholder="[email protected]" />
    <x-components.input label="Password" type="password" placeholder="••••••••" />
</div>

Without a label

Bare input, useful when the label is handled elsewhere.

<div class="flex w-full max-w-md justify-center">
    <x-components.input type="search" placeholder="Search…" />
</div>

Props

Prop Type Default Description
type text text The native input type (text, email, password, number, etc.).
label text Optional label rendered above the input.

Works with

`components:add input` pulls these in automatically.