© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
17 replies
Damien

Styling forms modal forms created with createOptionsForm()

I have a modal for creating contacts, if a company does not exist, I want to be able to create on on the fly so I am using
createOptionsForm()
createOptionsForm()
to create it in situ.

I am trying to styling it rather simply but I am struggling to get it to work correctly and I am unsure if it is possible or if I am barking up the wrong tree. I have attached a screenshot and the code is below:

Select::make('company_id')
->relationship('company', 'name')
->searchable()
->preload()
->placeholder('Select a company')
->columns(12)
->createOptionForm([
    TextInput::make('name')
        ->required()
        ->maxLength(255)
        ->columnSpan(12)
        ->label('Company Name'),
    TextInput::make('addr_line_1')
        ->columnSpan(2)
        ->required()
        ->columnSpan(6)
        ->maxLength(255),
    TextInput::make('addr_line_2')
        ->columnSpan(6)
        ->maxLength(255),
    //....
]),
Select::make('company_id')
->relationship('company', 'name')
->searchable()
->preload()
->placeholder('Select a company')
->columns(12)
->createOptionForm([
    TextInput::make('name')
        ->required()
        ->maxLength(255)
        ->columnSpan(12)
        ->label('Company Name'),
    TextInput::make('addr_line_1')
        ->columnSpan(2)
        ->required()
        ->columnSpan(6)
        ->maxLength(255),
    TextInput::make('addr_line_2')
        ->columnSpan(6)
        ->maxLength(255),
    //....
]),


I removed some of the inputs to keep it short.
image.png
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

Styling Forms Placeholder
FilamentFFilament / ❓┊help
3y ago
error on createOptionsForm in multiple forms in livewire page
FilamentFFilament / ❓┊help
3y ago
Forms hint opens a modal
FilamentFFilament / ❓┊help
2y ago
Filament Testing Forms in Modal
FilamentFFilament / ❓┊help
3y ago