Skip to main content

Button

A control that initiates an action.

Example​

<Button
title="Click the cool button"
action={doSomething}
buttonStyle="borderedProminent"
bold
/>
<Button action={doSomething} buttonStyle="borderedProminent">
<Label title="Hello world!" systemImage="person.fill" />
</Button>

Props​

Button inherits all View Modifiers as props.

propdescriptiontyperequireddefault
titleThe text of the button.stringyesundefined
actionThe action to perform when the user taps the button.() => voidyesundefined
childrenThe content of the button.ReactNodenoundefined