Skip to content

Button

Design guidelines

Buttons are used to trigger an action or an event. Button labels let the user know what to expect by clearly communicating what selecting the button will do or where it will take them.

HTML
React
Angular
BrandSecondaryDangerSuccessInverse
<certara-button color="brand">Brand</certara-button>
<certara-button color="secondary">Secondary</certara-button>
<certara-button color="danger">Danger</certara-button>
<certara-button color="success">Success</certara-button>
<certara-button color="inverse">Inverse</certara-button>
import { CertaraButton } from '@certara/certara-ui-react';
<CertaraButton color="brand">Brand</CertaraButton>
<CertaraButton color="secondary">Secondary</CertaraButton>
<CertaraButton color="danger">Danger</CertaraButton>
<CertaraButton color="success">Success</CertaraButton>
<CertaraButton color="inverse">Inverse</CertaraButton>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-button color="brand">Brand</certara-button>
<certara-button color="secondary">Secondary</certara-button>
<certara-button color="danger">Danger</certara-button>
<certara-button color="success">Success</certara-button>
<certara-button color="inverse">Inverse</certara-button>

(Note: Works on solid, outline, and link buttons)

HTML
React
Angular
Small button
<certara-button color="brand" size="sm">Small button</certara-button>
import { CertaraButton } from '@certara/certara-ui-react';
<CertaraButton color="brand" size="sm">Small button</CertaraButton>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-button color="brand" size="sm">Small button</certara-button>

(Note: Works on solid, outline, and link buttons)

HTML
React
Angular
Icon on left
<certara-button left-icon="plus">Icon on left</certara-button>
import { CertaraButton } from '@certara/certara-ui-react';
<CertaraButton leftIcon="plus">Icon on left</CertaraButton>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-button left-icon="plus">Icon on left</certara-button>

<certara-button> can also render as a hyperlink by giving it an href and make use of all the pre-built advantages like copying URLs, opening in new tabs, etc. Or, just maintain the appearance of a hyperlink. As always, use the right semantics for the situation when choosing between buttons and links.

HTML
React
Angular
Has dimensions of a link (inline, no padding)
Link Brand Danger Success
Inverse
<certara-button variant="reset" inner-class-name="link">Link</certara-button>
<certara-button variant="reset" inner-class-name="link text-brand">Brand</certara-button>
<certara-button variant="reset" inner-class-name="link text-danger">Danger</certara-button>
<certara-button variant="reset" inner-class-name="link text-success">Success</certara-button>
<div class="bg-inverse p-4">
<certara-button variant="reset" inner-class-name="link text-inverse">Inverse</certara-button>
</div>
import { CertaraButton } from '@certara/certara-ui-react';
<CertaraButton variant="reset" innerClassName="link">Link</CertaraButton>
<CertaraButton variant="reset" innerClassName="link text-brand">Brand</CertaraButton>
<CertaraButton variant="reset" innerClassName="link text-danger">Danger</CertaraButton>
<CertaraButton variant="reset" innerClassName="link text-success">Success</CertaraButton>
<div className="bg-inverse p-4">
<CertaraButton variant="reset" innerClassName="link text-inverse">Inverse</CertaraButton>
</div>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-button variant="reset" inner-class-name="link">Link</certara-button>
<certara-button variant="reset" inner-class-name="link text-brand">Brand</certara-button>
<certara-button variant="reset" inner-class-name="link text-danger">Danger</certara-button>
<certara-button variant="reset" inner-class-name="link text-success">Success</certara-button>
<div class="bg-inverse p-4">
<certara-button variant="reset" inner-class-name="link text-inverse">Inverse</certara-button>
</div>
HTML
React
Angular
<certara-button variant="icon" color="brand" aria-label="Move right">
<certara-icon icon="arrow-right" />
</certara-button>
<certara-button variant="icon" color="neutral" aria-label="Move right">
<certara-icon icon="arrow-right" />
</certara-button>
<div class="bg-inverse p-4">
<certara-button variant="icon" color="inverse" aria-label="Move right">
<certara-icon icon="arrow-right" />
</certara-button>
</div>
<certara-button variant="icon" color="danger" aria-label="Delete">
<certara-icon icon="trash" />
</certara-button>
<certara-button variant="icon" color="success" aria-label="Checked">
<certara-icon icon="circle-check" />
</certara-button>
import { CertaraButton, CertaraIcon } from '@certara/certara-ui-react';
<CertaraButton variant="icon" color="brand" aria-label="Move right">
<CertaraIcon icon="arrow-right" />
</CertaraButton>
<CertaraButton variant="icon" color="neutral" aria-label="Move right">
<CertaraIcon icon="arrow-right" />
</CertaraButton>
<div className="bg-inverse p-4">
<CertaraButton variant="icon" color="inverse" aria-label="Move right">
<CertaraIcon icon="arrow-right" />
</CertaraButton>
</div>
<CertaraButton variant="icon" color="danger" aria-label="Delete">
<CertaraIcon icon="trash" />
</CertaraButton>
<CertaraButton variant="icon" color="success" aria-label="Checked">
<CertaraIcon icon="circle-check" />
</CertaraButton>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-button variant="icon" color="brand" aria-label="Move right">
<certara-icon icon="arrow-right"></certara-icon>
</certara-button>
<certara-button variant="icon" color="neutral" aria-label="Move right">
<certara-icon icon="arrow-right"></certara-icon>
</certara-button>
<div class="bg-inverse p-4">
<certara-button variant="icon" color="inverse" aria-label="Move right">
<certara-icon icon="arrow-right"></certara-icon>
</certara-button>
</div>
<certara-button variant="icon" color="danger" aria-label="Delete">
<certara-icon icon="trash"></certara-icon>
</certara-button>
<certara-button variant="icon" color="success" aria-label="Checked">
<certara-icon icon="circle-check"></certara-icon>
</certara-button>
HTML
React
Angular
Only icon buttons support an active state
<certara-button active variant="icon" color="brand" aria-label="Move right">
<certara-icon icon="arrow-right" />
</certara-button>
<certara-button active variant="icon" color="success" aria-label="Checked">
<certara-icon icon="circle-check" variant="solid" />
</certara-button>
<certara-button active variant="icon-rounded" color="brand" aria-label="Bold">
<certara-icon icon="bold" variant="solid" />
</certara-button>
import { CertaraButton, CertaraIcon } from '@certara/certara-ui-react';
<CertaraButton active variant="icon" color="brand" aria-label="Move right">
<CertaraIcon icon="arrow-right" />
</CertaraButton>
<CertaraButton active variant="icon" color="success" aria-label="Checked">
<CertaraIcon icon="circle-check" variant="solid" />
</CertaraButton>
<CertaraButton active variant="icon-rounded" color="brand" aria-label="Bold">
<CertaraIcon icon="bold" variant="solid" />
</CertaraButton>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-button active variant="icon" color="brand" aria-label="Move right">
<certara-icon icon="arrow-right"></certara-icon>
</certara-button>
<certara-button active variant="icon" color="success" aria-label="Checked">
<certara-icon icon="circle-check" variant="solid"></certara-icon>
</certara-button>
<certara-button active variant="icon-rounded" color="brand" aria-label="Bold">
<certara-icon icon="bold" variant="solid"></certara-icon>
</certara-button>

active

Attributeactive
Typeboolean
Defaultundefined
Requiredfalse
DescriptionWhen true, button is active

block

Attributeblock
Typeboolean
Defaultfalse
Requiredfalse
DescriptionWhen true, button spans full width

color

Attributecolor
Type"brand" | "danger" | "inverse" | "neutral" | "secondary" | "success"
Default'brand'
Requiredfalse
DescriptionColor options for buttons

configAria

Attributeconfig-aria
Typeany
Default{}
Requiredfalse
DescriptionARIA overrides merged onto the inner element; reflected and mutable

disabled

Attributedisabled
Typeboolean
Defaultfalse
Requiredfalse
DescriptionDisables the control

href

Attributehref
Typestring
Defaultundefined
Requiredfalse
DescriptionWhen set, renders as anchor with this href instead of button

innerClassName

Attributeinner-class-name
Typestring
Defaultundefined
Requiredfalse
DescriptionCSS classes applied to the inner button or anchor

leftIcon

Attributeleft-icon
Typestring
Defaultundefined
Requiredfalse
DescriptionIcon name to appear on the left. List of available Font Awesome icons

popoverTarget

Attributepopover-target
Typestring
Defaultundefined
Requiredfalse
DescriptionID of popover element to control (Popover API)

popoverTargetAction

Attributepopover-target-action
Type"hide" | "show" | "toggle"
Defaultundefined
Requiredfalse
DescriptionPopover action

rightIcon

Attributeright-icon
Typestring
Defaultundefined
Requiredfalse
DescriptionIcon name to appear on the right. List of available Font Awesome icons

selected

Attributeselected
Typeboolean
Defaultundefined
Requiredfalse
DescriptionWhen true, button is selected DEPRECATED. Use active instead. Will be removed in the next major version.

showLoader

Attributeshow-loader
Typeboolean
Defaultfalse
Requiredfalse
DescriptionWhen true, shows spinner and disables interaction

size

Attributesize
Type"lg" | "md" | "sm"
Default'md'
Requiredfalse
DescriptionVisual size of button

target

Attributetarget
Type"_blank" | "_parent" | "_self" | "_top" | "_unfencedTop"
Defaultundefined
Requiredfalse
DescriptionLink target when href is set

type

Attributetype
Type"button" | "reset" | "submit"
Default'button'
Requiredfalse
DescriptionNative button type

variant

Attributevariant
Type"default" | "icon" | "icon-rounded" | "link" | "outline" | "reset"
Default'default'
Requiredfalse
DescriptionVisual style options for buttons
NameDescriptionBubbles
certaraBlurEmitted when the inner element loses focustrue
certaraClickEmitted on click when not disabled and not loading; detail includes element (host)true
certaraFocusEmitted when the inner element receives focustrue

There are no public methods available for this component

NameDescription
The default slot

Buttons are used to trigger an action or an event. Button labels let the user know what to expect by clearly communicating what selecting the button will do or where it will take them.

Brand Secondary Danger Success
Inverse

(Note: Works on solid, outline, and link buttons)

Small button

(Note: Works on solid, outline, and link buttons)

Icon on left
Link Brand Danger Success
Inverse

For more information, refer to the Icon page.

When multiple actions/options are needed it is important to distinguish their level of importance. Buttons have three levels of importance (primary, secondary, and tertiary).

The example below shows how to display buttons in order of importance (left to right), and the possible combinations when all three are in use.

Brand as primary Neutral as secondary Button link as tertiary
Brand as primary Brand as secondary Button link as tertiary
Danger as primary Neutral as secondary Button link as tertiary
Brand as primary Danger as secondary Button link as tertiary
  • Be clear and predictable for users to anticipate what will happen when they click a button
  • Lead with strong action verbs that encourage action and provide enough context. Use the {verb}+{noun} format except in common action like Save, Close, Cancel, or OK.
  • Be scannable: avoid unnecessary words and articles such as the, an, or a.

Generally: links go somewhere while buttons do something.

A link is focusable and can be triggered by the enter key. A link will redirect you to a new page or a section within the same page. In VoiceOver’s rotator, it will also be collected within the “Links” window. A link changes what the URL in the browser points to and then displays that website or file. (If the browser can’t display the file, it gets downloaded)

Buttons perform an action and are used for functionality that does not lead a user somewhere else. A button is focusable, too, and can be triggered by the space key. A button will trigger an action like opening or closing something, sending a form, expanding navigation, or show/hide. In most cases JavaScript is used to do this. In VoiceOver’s rotator, it will be collected within the “Form controls” window. Outside of submitting a form, a button is paired with Javascript, and without it, the usefulness of buttons is generally limited.

Buttons and links have two different roles, so assistive technologies announce them differently. Links are announced as “links”, while buttons are announced as “buttons”. Having these different roles means there are different user expectations. Not only that links go somewhere and buttons do something, but also their interactivity:

  • Links can be activated by pressing the return key only.
  • Buttons can be activated by pressing return or space.
  • Screen readers have a function to present a list of links to their users. Buttons cannot be as easily reached.
  • Buttons use the normal mouse pointer arrow, while links trigger the use of the pointing hand mouse pointer.
View component in Figma

Icon buttons (like Buttons) let users take action. Used for repeated or persistent actions on a page or toolbar, they lack visible labels to simplify the UI.

3

Include a Tooltip to help any users who may be unfamiliar with the icon.

Set the aria-label HTML attribute to its action (e.g., “Next”, “Delete”, “Resolve”, etc.). Learn about aria-labels.

View icon buttons in Figma