Skip to main content
FlexTextInput ← Back to Table of Contents

Summary

Single-line text input with pill layout, grouped action buttons, and optional toolbar features. Extends Filament TextInputall native TextInput APIs remain available.
ClassBjanczak\FilamentFlexFields\Filament\Forms\Components\FlexTextInput
ExtendsFilament\Forms\Components\TextInput
State typestring|null (or numeric types when using numeric(), etc.)
Model cast'name' => 'string' · 'email' => 'string'
FieldTypeflex_text_input
Playgroundflex-text-input slug in Flex Fields playground
Also suitable for mapped types such as email, password, url, phone, slug, and search when configured through FlexFieldFormBuilder.

Basic usage

Standard text input with icons

use Bjanczak\FilamentFlexFields\Filament\Forms\Components\FlexTextInput;
use Filament\Support\Icons\Heroicon;

FlexTextInput::make('email')
    ->label('Email')
    ->email()
    ->prefixIcon(Heroicon::Envelope)
    ->hintIcon(Heroicon::InformationCircle, 'Used for login and notifications.')
    ->live(debounce: 750)
    ->loading()
    ->default('hello@example.com');

Password with strength meter

use Bjanczak\FilamentFlexFields\Filament\Forms\Components\FlexTextInput;

FlexTextInput::make('password')
    ->password()
    ->revealable()
    ->copyable()
    ->passwordStrength()
    ->default('secret-password');

State & validation

Stored value

State is a string (or numeric when using numeric()).
$record->name; // string|null — e.g. "John Doe"

Validation rules

Works with all standard Filament validation rules: required(), email(), url(), numeric(), maxLength(), etc.

Configuration API

All methods accept Closure unless noted.
MethodTypeDefaultDescription
variant(string|Closure $variant)Setup'primary'Visual style: primary, secondary, flat, soft
speechDictation(bool|Closure $condition = true)SetupfalseEnable voice-to-text dictation
speechDictationLanguage(string|Closure|null $language)SetupnullLanguage code for dictation (e.g. en-US)
emojiPicker(bool|Closure $condition = true)SetupfalseEnable emoji picker action
characterCounter(bool|Closure $condition = true)SetupfalseShow character count meta row
clearable(bool|Closure $condition = true)SetupfalseShow clear button (×)
loading(bool|Closure $condition = true)SetupfalseShow spinner during Livewire requests
passwordStrength(bool|Closure $condition = true)SetupfalseShow password strength meter
passwordStrengthLabels(array|Closure $labels)SetupdefaultsCustom labels for strength scores 0–4
verificationStatus(string|Htmlable|Closure|null $status)SetupnullShow verification badge text
verificationStatusIcon(string|BackedEnum|Htmlable|Closure|null $icon)SetupSealCheckCustom verification icon
verificationStatusColor(string|Closure $color)Setup'primary'Color for verification badge
copyIcon(string|BackedEnum|Htmlable|Closure|null $icon)SetupCopyCustom copy action icon
showPasswordIcon(string|BackedEnum|Htmlable|Closure|null $icon)SetupEyeCustom show password icon
hidePasswordIcon(string|BackedEnum|Htmlable|Closure|null $icon)SetupEyeClosedCustom hide password icon
emojiIcon(string|BackedEnum|Htmlable|Closure|null $icon)SetupFaceSmileCustom emoji picker icon
microphoneIcon(string|BackedEnum|Htmlable|Closure|null $icon)SetupMicrophoneCustom dictation icon
size(string|ControlSize|Closure $size)Setup'md'Control size: sm, md, lg
rounding(string|Closure|null $rounding)SetupconfigBorder radius token

passwordStrengthLabels()

FlexTextInput::make('password')
    ->password()
    ->passwordStrength()
    ->passwordStrengthLabels([
        'Very weak', 'Weak', 'Fair', 'Good', 'Strong'
    ]);

verificationStatus()

Ideal for verified e-mails or domains:
FlexTextInput::make('email')
    ->verificationStatus('Verified')
    ->verificationStatusColor('success')
    ->verificationStatusIcon('heroicon-o-check-badge');

Real-world examples

Search input with clear button

FlexTextInput::make('search')
    ->label('Search records')
    ->placeholder('Type to filter...')
    ->prefixIcon('heroicon-o-magnifying-glass')
    ->clearable()
    ->live(debounce: 500);

Multi-language dictation

FlexTextInput::make('comment')
    ->speechDictation()
    ->speechDictationLanguage('pl-PL')
    ->emojiPicker();

Playground

/admin/flex-fields-playground/flex-text-input See Playground for setup.
ComponentWhen to use instead
FlexTextareaFieldFor multi-line text input
PhoneFieldFor formatted phone numbers with country flags
CurrencyFieldFor locale-aware currency input

CSS classes (reference)

ClassRole
fff-flex-text-input-fieldRoot wrapper
fff-flex-text-input-field--{sm|md|lg}Size modifier
fff-flex-text-input-field--{variant}Visual variant
fff-flex-text-input__trackInput container
fff-flex-text-input__actionsAction button group
fff-flex-text-input__metaMeta row (counter, strength)

Performance

MechanismWhat it does
Lazy Alpineflex-text-input.js loaded on demand via Filament x-load
Server-side MetaCharacter counter and strength bar are server-rendered for zero layout flash
Optimized IconsUses Gravity UI icons by default for a consistent SaaS look