Skip to content

Commit

Permalink
Action icon (#187)
Browse files Browse the repository at this point in the history
* Add documentation for action icons and action divider

* Update docs/3.0/customizable-controls.md

* improve img

* Update action icon and icon divider

* Update  message in customizable-controls for action icon and dividers

* tweaks

* actions_list tweak

* .

* versions

---------

Co-authored-by: gabrielgiroe1 <[email protected]>
  • Loading branch information
Paul-Bob and gabrielgiroe1 authored Apr 3, 2024
1 parent 82e0417 commit 5588571
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions docs/3.0/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,3 +592,40 @@ end
## StimulusJS

Please follow our extended [StimulusJS guides](./stimulus-integration.html#use-stimulus-js-in-a-tool) for more information.

## Divider <VersionReq version="3.5.6" />
Action dividers allow you to organize and separate actions into logical groups, improving the overall layout and usability.

Here's an example of how you can define actions dividers:

```ruby
def actions
action Avo::Actions::ToggleInactive
action Avo::Actions::ToggleAdmin
divider
action Avo::Actions::Sub::DummyAction
action Avo::Actions::DownloadFile
divider
action Avo::Actions::Test::NoConfirmationRedirect
action Avo::Actions::Test::CloseModal
end
```
<img :src="('/assets/img/action_divider.png')" class="border mb-4" />

## Icon <VersionReq version="3.5.6" />
Action icons allow you to enhance the visual representation of actions. Action icons provide a quick visual cue for users, helping them identify different actions at a glance.

Here's an example of how you can define actions with icons:

```ruby
def actions
action Avo::Actions::ToggleInactive, icon: "heroicons/outline/globe"
action Avo::Actions::ToggleAdmin
action Avo::Actions::Sub::DummyAction
action Avo::Actions::DownloadFile, icon: "heroicons/outline/arrow-left"
action Avo::Actions::Test::NoConfirmationRedirect
action Avo::Actions::Test::CloseModal
end
```

<img :src="('/assets/img/action_icon.png')" class="border mb-4" />
3 changes: 2 additions & 1 deletion docs/3.0/customizable-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ actions_list exclude: DisableAccount
# Or
actions_list exclude: [ExportSelection, PublishPost]
```

:::info
The list action's [icon](actions.md#icon) and the [dividers](actions.md#divider) are defined in `def actions` method.
:::

:::option `edit_button`
Expand Down
Binary file added docs/public/assets/img/action_divider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/assets/img/action_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5588571

Please sign in to comment.