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'),


i try to use this:

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

But this is not working, how can do this?
Thank you.
Was this page helpful?