Adding a note on top of a form

I am trying to show a small note section / card on top of the form to create a resource record. Section form component works great, but I can't disable the bottom part where the fields are supposed to go. I've been looking up the docs for a while, if there is something sutable, I can't find it. Any suggestion on how to handle this?
No description
Solution:
I don't want to be manually styling and setting views for it either. So here is what I came up with. It is not ideal but it does the trick. 1. Publish the section.index view form the support components provider 2. Publish the components.section view from from filament forms provider. 3. In the section.index checl if the component has a schema and pass it to the form section component <x-filament::section :has-components="(bool) $getChildComponentContainer()->getFlatComponents()" ... />...
Jump to solution
7 Replies
reppair
reppairOP2w ago
Found out I can make it collapse, but it still can be opened by clicking on the trigger. 🙂
Antea
Antea2w ago
Maybe dont use the heading and description and put a Placeholder form component with HtmlString as content And for the label of the Placeholder you can also render html I guess, Blade::render('<x-filament::icon icon="heroicon-m-check-circle" class="h-9 w-9 text-gray-950 inline-block" />')); something like that to render an icon as html and whatever you want after that
Antea
Antea2w ago
Filament
Simple Alert by CodeWithDennis - Filament
A plugin for adding straightforward alerts to your Filament pages.
reppair
reppairOP2w ago
Yeah, the above trick worked. The package requires building a custom theme, which we want to avoid if possible. It would've been ideal if it just did not render the empty space for the Section schema, when the schema is empty (has no child components).
Solution
reppair
reppair2w ago
I don't want to be manually styling and setting views for it either. So here is what I came up with. It is not ideal but it does the trick. 1. Publish the section.index view form the support components provider 2. Publish the components.section view from from filament forms provider. 3. In the section.index checl if the component has a schema and pass it to the form section component <x-filament::section :has-components="(bool) $getChildComponentContainer()->getFlatComponents()" ... /> 4. Accept the property in the section component @props(['hasComponents' => false, ...]) and use it in few of the checks to disable the click event listener, cursor style and the chevron trigger button. Then use it like usal, wiht defining a schema for it.
Section::make('Please note')
->description('Some wise description')
->icon('heroicon-o-information-circle')
->collapsible()
->collapsed(),
Section::make('Please note')
->description('Some wise description')
->icon('heroicon-o-information-circle')
->collapsible()
->collapsed(),
What do you think?
reppair
reppairOP2w ago
I am going to stick with it, I like it. Cheers!
Antea
Antea2w ago
By publishing views you will need to manually keep them up to date when the views are changed by a filament update

Did you find this page helpful?