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.
PHP

Pre-selected Value

Pass a value() to pre-select an icon on render.

PHP

Disabled

The picker can be disabled to prevent interaction.

PHP

JS API — setValue

Use the JS API to set or get the selected icon programmatically.

No icon selected.
JS

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->iconPicker($id)IconPickerCreate an IconPicker instance.
->icons(array $icons)selfSet the icon list. Each entry: ['value' => 'fa-star', 'text' => 'Label'].
->value(?string $value)selfPre-select an icon by its FA class (e.g. 'fa-star'). Default: null (none selected).
->name(string $name)selfForm field name for the hidden input.
->placeholder(string $p)selfLabel shown when no icon is selected. Default: 'Select an icon…'.
->disabled(bool $d)selfDisable the picker. Default: false.

JS JS Methods

Method / PropertyParametersDescription
m.iconPicker(id)object|nullGet the initialized IconPicker instance for the given element ID.
picker.getValue()stringReturn the currently selected icon value (FA class), or '' if none.
picker.setValue(value)voidProgrammatically select an icon by its FA class. Pass '' to clear.
picker.open()voidOpen the icon grid panel.
picker.close()voidClose the icon grid panel.

EVENT Events

Event NameDetailDescription
m:iconpicker:change{ id, value, label }Fired on the container element when the selected icon changes.