Rate this page:
Buttons are used as triggers for actions. A row of buttons is displayed in a ButtonSet.
1
import ForgeUI, { Button } from '@forge/ui';
Name | Type | Required | Description |
---|---|---|---|
onClick | () => void | Promise<void> | Yes | An event handler that can be asynchronous. You can execute state updates inside this function. |
text | string | Yes | The button's label text. |
appearance | string | The appearance of the button. Valid values are danger ,
default , link , subtle , subtle-link ,
and warning . Defaults to default . | |
appearance | "default" | "primary" | "link" | "subtle" | "subtle-link" | "warning" | The appearance of the button. | |
disabled | boolean | Whether the user interaction is disabled. Defaults to false. | |
icon | string | An icon to display with the button's text. Valid values are
icons from
@atlaskit/icon.
For example, "add-circle" or "graph-line" . | |
iconPosition | "before" | "after" | Where to render the icon relative to the text . Defaults to "before". |
A button with an asynchronous handler.
1 2 3 4 5 6
<Button
text="Sign up"
onClick={async () => {
await postSignup(data);
}}
/>
Rate this page: