Button
A control that initiates an action.
Example​
- swiftui-react-native
- SwiftUI
- React Native
<Button
title="Click the cool button"
action={doSomething}
buttonStyle="borderedProminent"
bold
/>
<Button action={doSomething} buttonStyle="borderedProminent">
<Label title="Hello world!" systemImage="person.fill" />
</Button>
Button("Click the cool button", action: doSomething)
.bold()
.buttonStyle(.borderedProminent)
<Button
onPress={doSomething}
title="Click the cool button"
style={styles.buttonStyle}
/>
Props​
Button inherits all View Modifiers as props.
prop | description | type | required | default |
---|---|---|---|---|
title | The text of the button. | string | yes | undefined |
action | The action to perform when the user taps the button. | () => void | yes | undefined |
children | The content of the button. | ReactNode | no | undefined |