fix(icons): render Nova Heroicons
This commit is contained in:
7 files changed
+30
-2
No files matched your search
@@ -37,6 +37,7 @@ public function fields(NovaRequest $request): array
|
||||
->add(
|
||||
Approve::make(),
|
||||
icon: 'check',
|
||||
iconType: 'solid',
|
||||
color: 'success',
|
||||
activeWhen: fn (Model $model) => $model->approved,
|
||||
disabledWhen: fn (Model $model) => $model->approved,
|
||||
@@ -71,6 +72,8 @@ view while removing them from the row ellipsis.
|
||||
`add()` accepts the following named arguments:
|
||||
|
||||
- `icon`: a Nova icon name, such as `check` or `x-mark`.
|
||||
- `iconType`: Heroicons `outline`, `solid`, `mini`, or `micro`; defaults to
|
||||
`outline`.
|
||||
- `color`: `default`, `primary`, `success`, `danger`, `warning`, or `info`.
|
||||
- `variant`: `outline`, `solid`, or `ghost`.
|
||||
- `label`: button/accessibility label; defaults to the action name.
|
||||
@@ -87,6 +90,23 @@ view while removing them from the row ellipsis.
|
||||
Callbacks receive `(Model $model, NovaRequest $request, Action $action)` and may
|
||||
declare only the leading arguments they need.
|
||||
|
||||
### Icons
|
||||
|
||||
Icons are rendered by Nova's `Icon` component from `laravel-nova-ui`, so the
|
||||
package supports Heroicons v2.1.5+ while always using the exact Heroicons
|
||||
release bundled by the installed Nova version. Use kebab-case names, including:
|
||||
|
||||
`check`, `x-mark`, `plus`, `minus`, `pencil-square`, `trash`, `eye`, `bolt`,
|
||||
`arrow-path`, `arrow-down-tray`, `paper-airplane`, `play`, `pause`, `lock-closed`,
|
||||
`lock-open`, `star`, `heart`, `bell`, `envelope`, `user`, `users`, `cog-6-tooth`,
|
||||
`document`, `document-check`, `clipboard`, `magnifying-glass`, and
|
||||
`exclamation-triangle`.
|
||||
|
||||
The package deliberately does not install a second Heroicons copy; importing
|
||||
Nova's UI component avoids version conflicts. For reference, Nova 5.8.3 in the
|
||||
test application declares and locks `@heroicons/vue` 2.2.0, whose icon API is
|
||||
compatible with the supported 2.1.5 baseline.
|
||||
|
||||
## Notes and limitations
|
||||
|
||||
- Actions must be normal resource actions registered by `actions()`. Pivot-only
|
||||
|
||||
Reference in new issue
Block a user