Button
Use the button component to help users carry out an action.
As in govuk-frontend, with preventDoubleClick a second click within a second is ignored, and
Space activates a link button.
Read the Design System guidance for button
Import
import { Button, StartButton, StartButtonContent, StartButtonIcon } from 'govuk-react/button';Examples
Default
Code
<Button>
Save and continue
</Button>Start
Code
<StartButton href="#">Start now</StartButton>Secondary
Code
<Button variant="secondary">
Find address
</Button>Warning
Code
<Button variant="warning">
Delete account
</Button>Disabled
Code
<Button disabled>
Disabled button
</Button>Prevent double click
Code
<Button preventDoubleClick>
Confirm and send
</Button>Link button
Code
<Button href="#">
Link button
</Button>Router link button
Code
<BrowserRouter>
<Button as={RouterLink} to="/">
Router link button
</Button>
</BrowserRouter>API reference
Button
Use the button component to help users carry out an action.
As in govuk-frontend, with preventDoubleClick a second click within a second is ignored, and
Space activates a link button.
| Prop | Type |
|---|---|
className | string |
variant | ButtonVariant |
preventDoubleClickPrevent accidental double clicks on submit buttons from submitting forms multiple times. This has no effect if | boolean |
as | undefined |
hrefRequired | string |
StartButton
Use a start button for the main call to action on your service's start page.
As in govuk-frontend, with preventDoubleClick a second click within a second is ignored, and
Space activates a link button.
| Prop | Type |
|---|---|
as | undefined |
hrefRequired | string |
className | string |
variant | ButtonVariant |
preventDoubleClickPrevent accidental double clicks on submit buttons from submitting forms multiple times. This has no effect if | boolean |
StartButtonContent
Wraps a start button's content when it isn't plain text.
No props of its own. Other props are passed to the element it renders.
StartButtonIcon
The arrow on a start button.
No props of its own. Other props are passed to the element it renders.