Loading...
A NSW Government website
Search for a command to run...
Buttons are interactive elements that guide people to take action. They link clearly to external pages or trigger specific interactions, and they work across devices and email platforms.
Buttons are a basic building block of email design. They're:
Well-designed buttons improve accessibility. They help people recognise the next step and make it easier to act, no matter what device or platform they're using.
Use buttons when you need to:
Avoid using buttons for:
Buttons are available in solid and outline styles, with left, centre and right alignment options to suit different layouts and content types.
Prop | Type | Default | Description |
---|---|---|---|
variant | string | solid | Determines whether the button is filled (solid) or outlined. Solid is the default and most common style. |
bgcolor | string | props.page.primary[800] | The background colour for the button. For solid buttons, this sets both the fill and border colour. For outline buttons, this sets the border colour. |
color | string | props.page.white (solid) or bgcolor (outline) | The text colour of the button. Defaults to white for solid buttons, or matches the border colour for outline buttons. |
align | string | left | Sets horizontal alignment of the button within its container. Commonly used for layout consistency with surrounding content. |
href | string | props.page.url | The URL the button links to. Always provide a valid href to ensure the button is accessible and functional. |
mobileClass | string | mobile-center | CSS utility class applied on mobile. Defaults to centring the button, but can be changed to support other mobile layouts. |
msoPt | string | 16px | Padding-top adjustment for Outlook-specific rendering, ensuring text appears vertically centred. |
msoPb | string | 27px | Padding-bottom adjustment for Outlook-specific rendering. Balances the vertical spacing in legacy clients. |