© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
TranceCode

How can use Pattern in my TextInput?

I have an input where I want to allow the entry of a maximum of 3 numbers separated from a . basically as if it were a float but instead of a comma a dot, I was searching and in the version of Filamentphp 2 it exists this:

->mask(fn (TextInput\Mask $mask) => $mask->pattern('+{7}(000)000-00-00'))

 Forms\Components\TextInput::make('size')
    //->rules(['max:3'])
    ->maxLength(3)
    ->live()
    ->placeholder('Ejemplo 1.70')
    ->numeric('^\d+(\.\d{1,2})?$')
    ->label('Altura'),
 Forms\Components\TextInput::make('size')
    //->rules(['max:3'])
    ->maxLength(3)
    ->live()
    ->placeholder('Ejemplo 1.70')
    ->numeric('^\d+(\.\d{1,2})?$')
    ->label('Altura'),


i try to use this:

->mask(function (TextInput\Mask $mask) {
        $mask->pattern('9{1,}.99');
    })
->mask(function (TextInput\Mask $mask) {
        $mask->pattern('9{1,}.99');
    })

But this is not working, how can do this?
Thank you.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to use mask in TextInput
FilamentFFilament / ❓┊help
3y ago
Can i use regex on TextInput::stripCharacters method?
FilamentFFilament / ❓┊help
2y ago
How can I get the helperText property of my TextInput
FilamentFFilament / ❓┊help
2y ago
how can use record in RelationManager ?
FilamentFFilament / ❓┊help
3y ago