ButtonStyleDefinition
required
The button style definition object.
Returns
AButtonStyleComponent. Call it, with no arguments or with props to customize its appearance per-use, and pass the result to the .buttonStyle() modifier on any Button.
Usage
Basic button style
With custom props
Applying a button style
Button styles are applied using the.buttonStyle() modifier. Call the style with no arguments, or with props to customize per-use.
Press feedback with gradient
Notes
- Button styles do not support view modifiers on the style itself — they only style button appearances.
- The
labelinButtonStyleConfigurationis the content passed as the first argument toButton(). It can be a string (rendered asText) or a custom component tree. - The
isPressedstate updates automatically when the user touches or clicks the button. - When calling the style with props (e.g.,
MyStyle({ color: "red" })), those props are available as the second argument to thebodyfunction. - The style must be assigned to
exports.defaultto be recognized as a button style component.
See Also
- defineComponent — for defining standard components