Icons in forms
Hi, is it possible to put a icon from hero icons in a selection so i can display it on my page?
Solution:Jump to solution
I am just reading the docs, but u can define which BladeIconSets you wanna use:
```php
IconPicker::make('icon')
->sets(['heroicons', 'fontawesome-solid']);...
19 Replies
please help!
where?
in my backend .. I have form -> selection where I want the person to let him choose between 3 icons
These need to be saved so I can display the icons on my homepage
you could just use the SVG's from the hero icons themselves and a custom view right
https://heroicons.com/ paste them from here into a blade view and do with it whatever you want
I have form -> selection.. What does it mean?
if you are using a custom view, you can do this
i use a selection ( dropdown menu ) from the documentation
In my form
what is the link?
Do you mean an icon select like this: https://filamentphp.com/plugins/guava-icon-picker
Filament
Icon Picker by Guava - Filament
Adds an icon picker field and column for your filament panel and form builder.
in this.. i want a person to choose his icon
Thats exactly what the plugin above does
@bernhard when i want to use it.. it says "Svg by name "bag" from set "default" not found." .. you know why?
i don't use this plugin atm, but this sounds like your bag is not in the set
i think the default set is heroicons and there is no "bag" in the heroicon set
Can U share your code?
btw, are you editing an existing record? This sounds for me like your record has an icon "bag" which is not existing in the set
Solution
I am just reading the docs, but u can define which BladeIconSets you wanna use:
And it looks like the IconPicker is using full icon names:
So when u have a value
bag
in your existing entry in the column icon
it will not work.Try to change the value in your DB (phpMyadmin for example) to
heroicon-o-shopping-bag
and check if its working
Or use it with empty fields/valuesi had this error today π
try it like this:
'heroicon-o-academic-cap'
oh nvm bernhard said the same :d
that worked thanks @bernhard and thanks @Patrick1989 :))
Please mark as solved π