This page showcases various buttons you can implement in your app, each designed for specific actions. Below is a detailed explanation of the different button types, their configurations, and their intended actions.
To see buttons in action, check out examples on this page.
Regular Buttons
The general structure of a button object is as follows:
To assign actions to a button, you can populate the actions array. Below are examples of common button actions.
Open a Modal
{"actions": [{"action":"showModal","options": {"body":"This is the modal body, actions are Kewl!","icon":"success","title":"<br>You triggered a modal!" } }],"buttonClasses":"btn btn-info btn-lg","icon":"fa fa-comment","styleClasses":"col-md-2","text":"Show a Modal","type":"button"}
Redirect to a Path
Internal Link
{"actions": [{"action":"path","options": {"path":"/dash" } }],"buttonClasses":"btn btn-info","hint":"This redirects the user to another form","styleClasses":"col-md-2","text":"Goto /dash","type":"button"}
External Link
{"actions": [{"action":"path","options": {"url":"https://docs.fmbetterforms.com/" } }],"buttonClasses":"btn btn-danger btn-xl btn-trans btn-pill","hint":"Styled with CSS, opens a new tab","styleClasses":"col-md-2","text":"Show Documentation","type":"button"}
Show Alert
{"actions": [{"action":"showAlert","options": {"text":"This is the Alert body, actions are Kewl!","title":"Hello World!","type":"error" } }],"buttonClasses":"btn btn-primary btn-block","hint":"Fills the column it defines","icon":"fa exclamation-triangle","styleClasses":"col-md-4","text":"Full Width showAlert","type":"button"}
JavaScript Function
The Print button action executes JavaScript functions:
This button uses buttonClasses_calc to dynamically generate CSS classes. It is a computed property that combines static classes with dynamic model data: