Action Button
Represents a Material UI styled button for performing actions with various visual styles.
Overview
The ActionButton
component allows you to create buttons with Material design styles, such as elevated, filled, tonal, outline, and text. It also offers stretched versions of these styles for buttons that need to occupy the maximum available width.
To use the ActionButton
, initialize it with a title key for the button’s text and an action closure that defines the button’s behavior when pressed.
Initializers
Creates a button with a default .filled
style.
Creates a button with a custom style.
For detailed descriptions of the available button styles, refer to the ActionButtonStyle.
Parameters
Parameter
Description
titleKey
The text key to display on the button.
style
The style of the button.
action
The closure to execute when the button is pressed.
Modifiers
Sets the corner radius for an action buttons.
Sets the font size for an action buttons within the environment.
Sets the font weight for an action buttons within the environment.
Example
Displays the action button with default ActionButtonStyle.filled
style.
Displays the action button with custom style.
Displays the action button with default style and custom corner radius, font style and font weight.
ActionButton
uses the default configuration's values for corner radius, font style, and font weight if custom values are not specified.
Last updated