Button

A button performs an action on the current page, such as submitting a form or confirming a decision.

When to use

  • The user needs to trigger an action that changes data or confirms an outcome, for example, submit, save, delete or confirm.
  • The user needs to trigger an action without navigating to a different page.
  • The user needs access to related actions within the same task or flow, for example, cancel or reset.

When not to use

  • If the interaction navigates to another page or URL, use Link instead.
  • If the interaction navigates but should look like a button, use Link Button instead.
  • If one trigger needs a primary action plus alternative actions, use Split Button instead.
  • If multiple actions are hidden behind a single trigger, use Menu instead.
  • If related toggle or selection actions belong together in one row, use Button Group instead.

Usage guidance

How to choose variants, shapes, fit, and icons to create a clear action hierarchy.

Button variants overview

The button component has three variants. Each has a different prominence level that controls how much attention the button attracts.

VariantProminenceVisual weight
FilledHighSolid background, maximum contrast. Draws the eye first.
OutlinedMediumBorder only, recedes behind filled. Visible but secondary.
PlainLowText only, minimal footprint. Present without demanding attention.

Establish action hierarchy

Most interfaces need three action levels at most. Start from the defaults below and deviate only when the context requires it.

  • Limit filled buttons to one per visible action group so the main action stays clear.
  • If several actions are equally important, use outlined instead of giving them all filled emphasis.
  • Use plain for repetitive or low-emphasis actions that should stay available without dominating the layout.
Button hierarchy: filled (Submit booking), outlined (Save draft), and plain (Cancel) show the default action configuration for most interfaces.
LevelAppearanceVariantWhen to use
Primary actionPrimaryFilledThe single main action per screen or section, such as submit, confirm, or continue.
Secondary actionNeutralOutlinedSupporting or alternative actions, such as save draft, cancel, or go back.
Tertiary actionNeutralPlainRepetitive or low-emphasis actions, such as reset, clear, or dismiss.
Do
A single filled button anchors attention on the primary action.
Don't
Multiple filled buttons at the same level dilute emphasis and leave the user uncertain which action is primary.

Neutral filled in modals, dialogs, and drawers

In modals, dialogs, and drawers, use the neutral filled button for the secondary action instead of neutral outlined. The container edge already frames the content, so an outlined border doubles against that edge and adds visual noise. A neutral fill removes the competing border while keeping the action clearly defined.

Do
In a modal, a neutral filled secondary avoids border-on-border noise and preserves hierarchy.
Caution
In a modal, an outlined secondary can create visual noise where its border meets the container edge.

The action order is also reversed from forms. In these contained surfaces, the primary action sits on the right. A modal, dialog, or drawer presents a single, focused decision rather than a long entry flow, so the user reads top to bottom and finishes scanning at the bottom-right corner.

Placing the commit action exactly where attention lands shortens the path from reading the content to confirming it. In open form layouts the primary sits first, on the left, to optimise reading and keyboard flow into the form.

Error filled for destructive actions

Use the error filled button for irreversible destructive actions: deleting an account, removing a vessel from a schedule, or purging shipment records. The red fill signals danger and forces the user to commit deliberately.

Pair it with a neutral secondary action (outlined or plain) so users have an obvious escape route. Only use error filled when the consequence is permanent. Reversible or routine actions do not need it.

Button, error filled: use for irreversible destructive actions paired with a neutral escape route.

Error in outlined or plain dilutes the danger signal without reducing prominence. It creates an unclear middle ground. If an action is destructive enough to need the error colour, use the filled variant.

Secondary filled, brand hero exception

Use the secondary filled button sparingly, only in Maersk-branded hero or stage elements that need stronger brand emphasis. It is an exception for hero contexts, not a general replacement for the primary filled button.

Button, secondary filled: reserved for Maersk hero contexts where stronger brand emphasis is needed.

Inverse for dark contexts

Use the inverse variant when buttons sit on dark backgrounds, dark-theme surfaces, or hero sections with dark imagery. Inverse buttons flip the colour relationship so the text and borders remain legible against the dark surface.

Button, inverse: use on dark backgrounds or hero imagery where standard variants would lose contrast and legibility.

Use rounded shape deliberately

Do not use the rounded shape as the default button style or mix rounded and regular buttons in the same action row without a clear semantic difference. In particular, do not use rounded buttons in form footers or table action rows where regular buttons are expected. These rules apply to brands that use the default rectangular button style.

Rounded floating button: a persistent helper that remains visible across screens without competing with task actions.
Rounded navigation buttons: previous/next controls in an image carousel use rounded shape because they are standalone navigation targets.

Rounded buttons work as isolated helper and navigation controls, not standard row actions. Because they are standalone controls, they typically appear alone. They do not form action hierarchies with other rounded buttons. A shipment support helper can stay visible across screens without competing with the main task action. Carousel navigation also works as rounded because the controls are standalone targets, not part of an action row.

Do
Regular-shaped buttons are expected in form footers and table action rows.
Don't
Rounded buttons in standard action rows break the visual convention and confuse the action hierarchy.

Buttons with icons

Add icons only when they clarify the action or outcome. Use a trailing icon only when it reinforces the result, and reserve icon-only buttons for universally understood actions.

Button icon treatment: leading icon clarifies the action (Download), trailing icon reinforces the result (Next step), icon-only for universally understood actions (delete).
Do
Icons that reinforce meaning: a download icon on 'Export manifest' communicates the outcome before the user acts.
Don't
Decorative icons on every button add visual noise without improving comprehension.

A button can use two icons when both serve a distinct purpose. Use a leading icon to identify the action and a trailing icon to signal a secondary behaviour such as opening a menu. An icon-only button with two icons works as a compact compound trigger where the combination is universally understood.

Two icons with label: the leading icon identifies the action, the trailing chevron signals a menu will open.
Two icons only: a compact compound trigger where both icons together communicate the action without a label.

Button with a badge

Use a badge on a button when the user needs a persistent count or status indicator tied to the action, such as pending documents or unread notifications. The badge should update dynamically and remain visible regardless of the button state.

Labelled button with badge: use this pattern to surface lightweight status tags like 'New' on a prominent action.
Icon-only button with status dot: use for notifications where a subtle unread indicator is needed without adding text.

Spacing between buttons

Use consistent spacing between buttons in an action row. Tight spacing groups related actions visually. Wider spacing separates actions that serve different purposes, such as a primary submit and a destructive reset on opposite ends of a form footer. For spacing values, see the spacing guidelines.

Choose the right fit

The button component supports three fit sizes: small, medium, and large. Choose the fit by the density of the surrounding layout, not by device or screen size. Medium is the default and works everywhere, including touch and mobile. Pick medium unless a dense layout genuinely needs small, or the context needs the extra presence of large. You don’t need to change the fit per device — choose a fit for the context and let the component handle rendering across screen sizes.

Button fit: small for dense data layouts, medium as the default for almost everything, large when the action needs extra presence.
FitUse whenExamples
SmallSpace is tight and the surrounding controls are denseTable rows, compact toolbars, filter bars, inline actions.
MediumThe default for almost everything, pointer and touch alikeForms, dialogs, page-level actions, most desktop and mobile UI.
LargeThe action needs extra presenceMarketing heroes, kiosk and POS screens, prominent standalone CTAs.

Use one fit per local context and match it to the density of the controls around it. Buttons in a table toolbar should share the small fit of the inputs beside them, while a form’s submit action should match its medium-fit fields. Mixing fits in the same action row creates visual imbalance and breaks the hierarchy.

You don’t need to change the fit for touch devices or smaller screens. Medium already provides a comfortable tap target on touch, so keep it as the default rather than swapping to large by hand. The one thing to avoid is small for primary touch actions. Small is built for pointer precision in dense desktop views, and its tap target is too tight for reliable touch use.

For more detail on fit sizes across the design system, see the component fit guidelines.

Full-width buttons

Use full-width buttons only in narrow containers or mobile layouts where the button should fill the available width. This prevents small tap targets on touch devices and gives the action visual prominence in a constrained space.

Full-width in a constrained card: the primary 'Continue' action stretches edge to edge so it stays prominent and easy to tap.

Patterns

Form actions

Pair a filled primary action with an outlined secondary action, align the primary action with the form content, and place the secondary action to its right so keyboard flow reaches the main action first.

Do
Do: align the primary action with form content and place it first so keyboard flow reaches the main action before the secondary.
Don't
Don't: reversing the action order forces keyboard users past the secondary to reach the primary, breaking expected reading flow.

For broader guidance on form layout and button placement, see the form design guidelines.

Repetitive and low-emphasis actions

Use low-key button styles for actions users perform often and repeatedly, especially in dense interfaces like table rows or expandable content lists. Prefer icon-only or plain buttons when the action is universally understood and should stay available without competing with primary goals. Use labelled variants only when the action is specific, ambiguous, or needs extra clarity.

Table row actions: keep repeatable row-level actions low-emphasis so dense data views stay scannable.

For progressive disclosure actions such as “Show details” or “Load more”, use a plain button so repetitive triggers stay low-emphasis while remaining discoverable.

Progressive disclosure: a plain button keeps the trigger low-emphasis and avoids competing with primary actions on the page.

Empty state actions

Use a single clear call-to-action button in an empty state so users understand the next step when no data is available.

Empty state with a single outline button: gives the user one clear path forward when no data exists yet.

Content guidance

  • Write button labels in sentence case. Capitalise the first word and proper nouns only.
  • Lead with an action verb and add a noun only when it removes ambiguity, for example Book a container.
  • Avoid vague labels such as Submit or Confirm. Name the action instead, for example Submit booking or Confirm release.
Do
Do: sentence case keeps labels scannable, consistent with the rest of the interface, and avoids competing for visual weight with the button itself.
Don't
Don't: all caps adds visual noise, weakens scannability, and makes action rows harder to parse at a glance.

Users rely on clear and consistent labels. See our label guidelines for broader writing guidance.

States and feedback

  • Default: the button shows its variant and emphasis level.
  • Hover: the background shifts slightly to confirm the button is interactive.
  • Focus: focus ring is visible so the user can visually find and activate the action.
  • Active: a pressed state becomes visible while the user commits the action.
  • Disabled: the background is faded so it is clear that the action is not available yet.
  • Loading: show that the action is processing and prevent duplicate submissions.

Disable buttons only when the action is truly unavailable and the user can fix the condition. If the action is available but input is invalid, keep the button enabled and show validation guidance instead.

For disabled buttons, add a tooltip that explains what is unavailable, why it is unavailable, and what the user needs to do to enable it.

Use the loading state only for short waits (about 2 to 5 seconds). For longer operations, show progress in a dedicated Progress indicator or a status view instead of keeping the button in loading state.

Disabled button with guidance: use a tooltip to explain why the action is unavailable and what the user needs to do next.
Button in loading state: shows the action is processing and prevents duplicate submissions. Use only for short waits of 2 to 5 seconds.

Accessibility

  • Always provide a label for icon-only buttons so assistive technologies can announce the action. For example, an icon-only delete action still needs an accessible name such as Remove container.
  • Follow the label guidance in Content guidance above. Clear labels benefit everyone, especially screen reader users.
  • Ensure buttons can be activated with Enter and Space when focused.
Button, icon-only: always provide an accessible name. The icon communicates the action visually, but assistive technologies need explicit label text.

The component already handles focus-ring styling, renders an accessible label for icon-only buttons from the label property, and sets aria-busy during loading.

ComponentUse case
Link ButtonWhen the action navigates to a URL but needs button-level visual weight
LinkWhen the interaction is purely navigational within body text
Split ButtonWhen one trigger needs a primary action plus a set of alternatives
MenuWhen multiple actions need to be consolidated behind a single entry point
Button GroupWhen related toggle or selection buttons belong together in one row
BadgeWhen the button needs a persistent count or status indicator such as pending documents or unread notifications

See also