Button
Button is used to initiate actions on a page or form.
On this page
On this page
Import
import {Button} from '@primer/react'
Examples
Props
Button
Name | Default | Description |
---|---|---|
childrenRequired | React.ReactNode The content of the button. | |
countRequired | number | string For counter buttons, the number to display. | |
variant | 'default' | | 'default'
| 'primary'
| 'danger'
| 'outline'
| 'invisible' Change the visual style of the button. |
size | 'medium' | | 'small'
| 'medium'
| 'large' |
leadingIconDeprecated | React.ComponentType<OcticonProps> An icon to display before the button text. | |
leadingVisual | React.ElementType A visual to display before the button text. | |
trailingIconDeprecated | React.ComponentType<OcticonProps> An icon to display after the button text. | |
trailingVisual | React.ElementType A visual to display after the button text. | |
as | 'button' | React.ElementType |
sx | SystemStyleObject | |
ref | React.RefObject<HTMLButtonElement> |