button (v1) (deprecated)
button
(v1) is deprecated
Support for button
v1 has been dropped from the JourneyApps Runtime. Please upgrade to button
v3 to ensure that your app remains compatible with the latest versions of the JourneyApps Runtime.
Three variations of buttons are available in JourneyApps:
Regular buttons
Menu buttons - which is a
button
placed inside amenu
component.Primary button - which is fixed to the bottom of the view and spans its full width.
Buttons can be used to trigger functions:
Calling a JavaScript/TypeScript function - by specifying
on-press="example_function()"
.Calling link functions directly - by specifying
on-press="link.view_path()"
.
Using Buttons
Buttons should be used when you need a user to perform a specific action on your view. They should be worded clearly so that users know what will happen when they click it. In general, a view shouldn't contain too many buttons, otherwise they start to compete with one another and overwhelm the user. If you find yourself using buttons everywhere, you may need to determine whether your view has too many actions on it, or whether a list
would work better instead.
Buttons are appropriate for actions such as "create", "add", "new", "edit", "update", "complete", "save", "proceed", "log in", etc.
Regular Button
Menu Button
Primary Button (Special Case)
A special case of the Regular Button is also available. This button is displayed on the bottom of the screen and spans the entire width (excluding sidebar). Use this button when your page has one main call-to-action. These buttons work well for actions like "Done" / "Complete" / "Log in" / "Proceed".
A button can be made into a Primary button by adding type="primary"
to its tag:
Configuration
Option | Required | Details |
---|---|---|
| required | Text to display on the button. It can be a format string to make the text dynamic. To have no label, specify |
| optional | Function to call when the button is pressed - either a JavaScript/TypeScript function or a navigation function. |
| optional | Set to |
| optional | Setting |
| optional | Controls whether the component is hidden or shown. The argument specified to |
| optional | The opposite of |
| optional |
|
| optional | Text to display when the user clicks on a disabled button (Available from JourneyApps Container v4.23.0) |
Configuration specific to Menu Buttons
The following apply only to menu
buttons (i.e. button
inside a menu component).
Option | Required | Details |
---|---|---|
| optional | The icon to display on the button, left of the text. The icon can be a Font Awesome icon, an Ionicons icon or the path of a custom icon (icons upload using the Assets workspace in OXIDE) |
| optional | Text to display below the normal button text, in a smaller font. It can be a format string to make the text dynamic. |
See Also
The menu
component can be used to render buttons in a menu. However, the recommended way of creating menus is now using the list
component.
Last updated