Input
Text input with label, hint, icons, prefix and suffix, and inline validation errors.
Basic usage
Enter your full name
Blade
<x-input /><x-input placeholder="Your name" /><x-input label="Name" placeholder="Your name" /><x-input label="Name" placeholder="Your name" hint="Enter your full name" />
Required field
Blade
<x-input label="Name *" placeholder="Your name" />{{-- OR --}}<x-input label="Name" placeholder="Your name" required />
Icon
Blade
<x-input label="Name" icon="user" placeholder="Your name" /><x-input label="Name" icon-right="user" placeholder="Your name" />
Prefix Suffix
https://
@gmail.com
Blade
<x-input label="Website" prefix="https://" placeholder="example.com" /><x-input label="Email" suffix="@gmail.com" placeholder="example@gmail.com" />
Prepend Append
- Maximum limit of items reached
-
- Maximum limit of items reached
-
Blade
Copy
@php $users = App\Models\User::pluck('name', 'id'); $countries = collect([ ['id' => 1, 'name' => 'BD'], ['id' => 2, 'name' => 'In'], ['id' => 3, 'name' => 'USA'], ['id' => 4, 'name' => 'UK'], ['id' => 5, 'name' => 'Russia'], ])->pluck('name', 'id');@endphp <x-input label="User"> @slot('prepend') <x-select :options="$users" placeholder="User" /> @endslot</x-input> <x-input label="Countries"> @slot('append') <x-select :options="$countries" placeholder="Country" /> @endslot</x-input>
Inline
Blade
Copy
<x-input placeholder="Your name" inline /><x-input label="Name" placeholder="Your name" inline />
Size variants
Blade
Copy
<x-input placeholder="xs" xs /><x-input placeholder="sm" sm /><x-input placeholder="md" md /><x-input placeholder="lg" lg /><x-input placeholder="xl" xl />
Rounded corner
Blade
Copy
<x-input placeholder="default" /><x-input placeholder="rounded-none" rounded-none /><x-input placeholder="rounded-sm" rounded-sm /><x-input placeholder="rounded-md" rounded-md /><x-input placeholder="rounded-lg" rounded-lg /><x-input placeholder="rounded-xl" rounded-xl /><x-input placeholder="rounded-2xl" rounded-2xl /><x-input placeholder="rounded-3xl" rounded-3xl /><x-input placeholder="rounded-full" rounded-full />
Customize input
Apply standard
css classes to style input fields and use the class:icon attribute for icon customization.
Blade
Copy
<x-input label="Name" icon="user" placeholder="Name" class="py-2 text-xs border-primary/60 focus:border-primary" class:icon="size-3.5" />