The button style definition object.
Returns
AButtonStyleComponent that can be passed to the .buttonStyle() modifier on any Button. The returned style can also be called with props to customize its appearance per-use.
Usage
Basic button style
With custom props
Applying a button style
Button styles are applied using the.buttonStyle() modifier. Pass the style directly or call it 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