Tabris.js Widgets: Action

The Action class represents an interactive entry in the navigation toolbar (NavigationView). Action can be imagined as something similar to tag in HTML or Tabris.js Button widget. The key difference is that Action can’t be appended to any Composites except NavigationView and meant to work only as a part of the navigation menu.

This is how simple Action looks in JS syntax:

And the same example in JSX:

Image and title properties specify an icon image and description text for the action, and onSelect() defines what will happen once the action is clicked.

If there are too many actions on the navigation bar, some of them will be hidden inside a dropdown action menu. Use overflow value for the placement property to put some actions inside the dropdown right away. You also got the option to put an action icon to the top left position that is normally occupied by the drawer/back button by changing placement value to navigation. This way you can create a custom “go back” button or replace it with a “close” button, for example:

Use the widget documentation page to see more detailed information.