F
Filamentβ€’2mo ago
Juju

How to change the Fields Color

I'm a newbie in PHP development overall, I try to make form using Form Builder and I'm trying to change the label color into black. I already try using extraInputAttributes and extraAttributes, but the color just won't change. Also how to remove the extra arrow in the Select Fields. Thank you in Advance πŸ™‚
No description
7 Replies
Lara Zeus
Lara Zeusβ€’2mo ago
it seems you missed some steps from the installation if you're using the from as a standalone, follow these: https://filamentphp.com/docs/3.x/forms/installation
Juju
JujuOPβ€’2mo ago
Hi, thank you for the reply I pretty much follow the Installation steps here is my form definition
public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')
->extraInputAttributes(['class' => 'text-black px-1 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6'])
->label('Nama Pemesan')
->autocapitalize('words')
->minLength(3)
->validationAttribute('Nama pemesan')
->validationMessages([
'min' => ':attribute harus lebih dari 3 karakter',
'required' => ':attribute tidak boleh kosong',
])
->autofocus(),
Select::make('district_id')
->relationship(name: 'district', titleAttribute: 'name')
->label('Distrik / Wilayah')
->placeholder('silahkan pilih distrik / wilayah')
->extraAttributes(['class' => 'appearance-none'])
->markAsRequired(false)
->required(),
->statePath('data')
->model(Transaction::class);
}
public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')
->extraInputAttributes(['class' => 'text-black px-1 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6'])
->label('Nama Pemesan')
->autocapitalize('words')
->minLength(3)
->validationAttribute('Nama pemesan')
->validationMessages([
'min' => ':attribute harus lebih dari 3 karakter',
'required' => ':attribute tidak boleh kosong',
])
->autofocus(),
Select::make('district_id')
->relationship(name: 'district', titleAttribute: 'name')
->label('Distrik / Wilayah')
->placeholder('silahkan pilih distrik / wilayah')
->extraAttributes(['class' => 'appearance-none'])
->markAsRequired(false)
->required(),
->statePath('data')
->model(Transaction::class);
}
Lara Zeus
Lara Zeusβ€’2mo ago
are you using panels or only forms?
Juju
JujuOPβ€’2mo ago
OMG my bad you're right i forgot to input 1 line in the tailwind.config.js thanks for the help
Juju
JujuOPβ€’2mo ago
I just at the line with the blue arrow
No description
Lara Zeus
Lara Zeusβ€’2mo ago
ya that one is important πŸ™‚
Juju
JujuOPβ€’2mo ago
lol critical 1 line
Want results from more Discord servers?
Add your server