Button

Displays a clickable button element.

asChild

boolean

color

grayyellowredpurple
Default: gray

ghost

booleanDefault: false

highContrast

boolean

loading

booleanDefault: false

radius

smallnonemediumlargefull

size

1234

type

buttonsubmitreset
Default: button

Deprecated

state

deprecated
disablednormalloading

Also supports MarginProps: `m`, `mb`, `ml`, `mr`, `mt`, `mx`, `my`

color
gray
yellow
red
purple
ghost
highContrast
loading
radius
small
none
medium
large
full
size
1
2
3
4
<Button radius="small" size="1">Button</Button>

Use the color prop to control the color of the button.

Use the ghost prop to create a deemphasized button.

Use the size prop to control the size of the button.

The state prop is deprecated, as the types of state it represents may not be mutually exclusive. Use disabled or loading instead.

Use the loading prop to indicate that the button is in a loading state. When loading is true the button is disabled by default.

When button changes to a loading state, screen readers announce “Loading, please wait.”

Loading and disabled buttons are focusable for accessibility reasons, but can’t be clicked and don’t submit forms.

You may nest icons directly inside the buttons. The correct gap between the icon and the text is provided automatically.

Dashboard

15 variants found

Primary button in Tax Information Formdashboard
color=purple
Primary button in Custom Attribute Mapping In Admin Portal Dialogdashboard
color=purple
Button in Delete Application Dialogdashboard

/:environmentId/applications/:applicationId

Button in Oauth Providers Clientdashboard

/:environmentId/authentication/oauth-providers

Destructive button in Delete Application Dialogdashboard

/:environmentId/applications/:applicationId

color=red
Destructive button in Delete Log Stream Dialogdashboard

/:environmentId/log-streams/:logStreamId

color=red
Destructive ghost button in Manage Platform Dialogdashboard
ghost=truecolor=red
Destructive ghost button in Manage Custom Email Provider Dialogdashboard
ghost=truecolor=red
Primary ghost size 1 button in Parent Resource Types Selectordashboardstatic

/:environmentId/roles-and-permissions/resource-types/edit/content-panel

<Flex align="center" gap="2" justify="between"> <Flex align="center" gap="2"> <Label as="span">Parents</Label> <Tooltip content={ <span style={{ maxWidth: 160, display: 'block' }}> This resource type can be assigned to any of the selected parents. </span> } > <Flex asChild align="center"> <span> <InfoCircledIcon color="var(--gray-9)" height={14} width={14} /> </span> </Flex> </Tooltip> </Flex> <Combobox.Anchor> <Combobox.Trigger disabled={!hasAvailableParentsToAdd}> <Button ghost color="purple" disabled={!hasAvailableParentsToAdd} size="1" style={{ margin: 0 }} {...(open ? { 'data-state': 'open' } : {})} > <PlusIcon /> Add parent </Button> </Combobox.Trigger> </Combobox.Anchor> </Flex>
ghost=truecolor=purplesize=1
disabled button in Directory Role Mapping Carddashboard
disabled=true
disabled button in Decoy Widgetsdashboard
disabled=true
Destructive size 1 button in Jit Provisioning Dialogdashboard
color=redsize=1
Destructive size 1 button in Connection Metadata Manualdashboard
color=redsize=1
size 1 button in Add User To Organization Dialogdashboard
size=1
size 1 button in Jit Provisioning Dialogdashboard
size=1

Context

PropTypeDefaultRequired
asChild
booleanno
color
"gray" | "yellow" | "red" | "purple"grayno
ghost
booleanfalseno
highContrast
booleanno
loading
booleanfalseno
radius
"small" | "none" | "medium" | "large" | "full"no
size
Responsive<"1" | "2" | "3" | "4">no
statedeprecated
"disabled" | "normal" | "loading"no
type
"button" | "submit" | "reset" | nullbuttonno

Also supports MarginProps: m, mb, ml, mr, mt, mx, my

stateType: "disabled" | "normal" | "loading"

Usage

Used 1021 times across 2 packages

Dashboard
941
Admin Portal
80

Variant Distribution

color

purple
61%
red
19%
gray
19%
yellow
0%

ghost

true
100%

size

1
53%
2
42%
3
5%

disabled

true
100%

radius

full
100%

loading

true
50%
false
50%

Where it's used

504 files

packages/dashboard/src/legacy-pages/[environmentId]/organizations/[organizationId]/domains/add-domains-dialog/add-domains-dialog.spec.tsx14
packages/dashboard/src/components/self-service-slack-channel/self-service-slack-channel-callout.tsx12
packages/dashboard/src/components/organizations/organization/admin-invitation.tsx8
packages/dashboard/src/components/billing/invoice-card.stories.tsx7
packages/dashboard/src/components/configuration/stripe-entitlements/dialogs/connected-dialog.tsx7
packages/dashboard/src/components/organizations/organization/domain-policy-dialog.tsx7
packages/dashboard/src/components/users/user-details.tsx7
packages/dashboard/src/components/configuration/request-oauth.tsx6
packages/dashboard/src/components/events/datadog-stream-configuration.tsx6

/:environmentId/authentication

packages/dashboard/src/app/(private)/(sidebar)/[environmentId]/authentication/authentication-legacy.tsx8

Show 494 more files