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:

  1. Regular buttons

  2. Menu buttons - which is a button placed inside a menu component.

  3. Primary button - which is fixed to the bottom of the view and spans its full width.

Buttons can be used to trigger functions:

  1. Calling a JavaScript/TypeScript function - by specifying on-press="example_function()".

  2. 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

<button label="Press Me" on-press="sayHello" />
<menu>
    <button label="Search for Item" subtext="Search through items by name" icon="icons/search-icon.png" on-press="sayHello" />
</menu>

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:

<button type="primary" label="I Have Started Work" on-press="started()" />

Configuration

Configuration specific to Menu Buttons

The following apply only to menu buttons (i.e. button inside a menu component).

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