IconPicker
A dropdown-style picker that shows a configurable grid of Font Awesome icons. Selecting an icon updates the trigger label and a hidden form input for submission. Default: no icon selected (shows placeholder).
Basic
A picker with a predefined icon list and no initial selection.
No icon selected.
Pre-selected Value
Pass a value() to pre-select an icon on render.
Disabled
The picker can be disabled to prevent interaction.
JS API — setValue
Use the JS API to set or get the selected icon programmatically.
No icon selected.
PHP PHP Methods (Fluent)
| Method / Property | Parameters | Description |
|---|---|---|
$m->iconPicker($id) | IconPicker | Create an IconPicker instance. |
->icons(array $icons) | self | Set the icon list. Each entry: ['value' => 'fa-star', 'text' => 'Label']. |
->value(?string $value) | self | Pre-select an icon by its FA class (e.g. 'fa-star'). Default: null (none selected). |
->name(string $name) | self | Form field name for the hidden input. |
->placeholder(string $p) | self | Label shown when no icon is selected. Default: 'Select an icon…'. |
->disabled(bool $d) | self | Disable the picker. Default: false. |
JS JS Methods
| Method / Property | Parameters | Description |
|---|---|---|
m.iconPicker(id) | object|null | Get the initialized IconPicker instance for the given element ID. |
picker.getValue() | string | Return the currently selected icon value (FA class), or '' if none. |
picker.setValue(value) | void | Programmatically select an icon by its FA class. Pass '' to clear. |
picker.open() | void | Open the icon grid panel. |
picker.close() | void | Close the icon grid panel. |
EVENT Events
| Event Name | Detail | Description |
|---|---|---|
m:iconpicker:change | { id, value, label } | Fired on the container element when the selected icon changes. |