Skip to main content Skip to navigation

Components: HasIcon

How to use

Components that use this trait can render an icon.

Hiker provides a selection of built-in icons you can use just by referencing their name. You can, however, also use custom icons.

For more information, view the Icon component documentation.

Component::make()
    ->icon('user');

Available methods

icon(string|Hiker\Components\Icon\Icon $icon)

Set the icon by its name, file path, or with a component instance.

Component::make()
    ->icon('user');