Skip to content
TallCraftUI

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

Blade
@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
<x-input placeholder="Your name" inline />
<x-input label="Name" placeholder="Your name" inline />

Size variants

Blade
<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
<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
<x-input label="Name" icon="user" placeholder="Name" class="py-2 text-xs border-primary/60 focus:border-primary" class:icon="size-3.5" />

API reference

Props are read from the component classes in TallCraftUI 3.0.0-beta.1. Write them in kebab-case and pass booleans as bare attributes, for example <x-button outline />. Other attributes, such as class or wire:model, are passed to the component's element.

<x-input>

View source
Prop Type Default
label string null
icon string null
icon-left string null
icon-right string null
hint string null
prefix string null
suffix string null
inline bool false
prepend mixed null
append mixed null
prepend-is-select bool true
append-is-select bool true
Sizes
xs sm md lg xl 2xl
Config
input.size = md input.border-radius = rounded-sm Change defaults