Skip to content

Types of Buttons in UI Design: When to Use Each One

Primary, secondary, outline, ghost, destructive, icon, split, toggle, button group, floating action and copy buttons: what each is for, with live React examples.

By , MiniDev7 min read

Buttons are the verbs of an interface. The hard part is not drawing one, it is deciding how loud each one should be, so the action people need is the obvious one and the dangerous one is never an accident. This guide covers the button types used in websites and SaaS products, how they rank in visual weight, and when to use each, with a live example of every type from MiniDev UI.

Button picker

You needUseAvoid
The main action on the screenPrimary buttonTwo primary buttons side by side
An alternative actionSecondary or outline buttonA second primary button
A low-key action in a toolbar or rowGhost buttonHeavy filled buttons in every row
Delete, remove, cancel a subscriptionDestructive buttonA destructive action with no confirmation
A compact, universally known actionIcon buttonIcons only for unusual actions
One action with variationsSplit buttonTwo separate buttons
Several related actions togetherButton groupA row of unrelated buttons
An on/off or one-of-many choiceToggle and toggle groupCheckboxes styled as buttons
Copy a value to the clipboardCopy buttonAsking people to select text
The one action on a mobile screenFloating action buttonFABs on desktop websites

Buttons by visual weight

Most design systems have four weights: primary (filled with the brand colour), secondary (filled with a neutral colour), outline (a border only) and ghost (no border until hover). A screen reads like a hierarchy: one loud button, a few quieter ones, and the rest as text-like actions.

Primary button

The filled, high-contrast button for the single most important action: Sign up, Save, Pay, Create project. Its job is to be found instantly.

Best for: the main action of a page, form or dialog. Avoid when: you are tempted to use it twice; two primary buttons compete and slow the decision. Tip: use a specific verb (Create invoice) rather than a vague one (Submit), and keep the label to one to three words.

Loading the live Button…
ButtonEvery variant side by side, from primary to ghost.Docs

Secondary and outline buttons

Secondary buttons have a neutral fill, outline buttons only a border. Both say this is an option, not the recommended path: Cancel next to Save, Watch demo next to Start free trial.

Best for: alternative actions next to a primary button, and actions that matter but are not the main one. Avoid when: the screen has no primary action; then the strongest button should simply be primary. Tip: put the secondary action on the left and the primary on the right in dialogs, and keep that order everywhere in the product.

Ghost button

A ghost button has no background or border until it is hovered. It reads almost like text, which makes it right for repeated, low-stakes actions.

Best for: toolbars, table rows, card footers, navigation inside apps. Avoid when: it is the only way to do something important; people may not see it as clickable. Tip: give ghost buttons an icon or a hover background so they are recognisably interactive.

Destructive button

A red button for actions that delete data or cannot easily be undone: Delete workspace, Remove member, Cancel subscription.

Best for: the confirm button of a destructive action, and danger zones in settings. Avoid when: the action is reversible; offer Undo in a toast instead of interrupting with a red button. Tip: put the destructive action behind a confirmation dialog that names exactly what will be lost, and make the safe option the default focus.

Loading the live Alert Dialog…
Alert DialogA destructive action confirmed in a dialog.Docs

Buttons by shape and job

Icon button

A square button that shows only an icon: close, edit, more, search, settings. It saves space in dense interfaces such as toolbars and table rows.

Best for: actions whose icons everyone knows. Avoid when: the icon is ambiguous, which is most icons beyond the obvious ten; add a text label instead. Tip: every icon button needs an aria-label and a tooltip with the same words.

Loading the live Icon Button…
Icon ButtonIcon buttons with tooltips.Docs

Split button

A split button has a main part that runs the default action and a small arrow that opens related alternatives: Save, with Save as draft and Save and close in the menu.

Best for: one common action with less common variations, such as Deploy, Merge or Export. Avoid when: the options are equally common; use a regular dropdown so nobody runs the default by accident. Tip: make the default the safe, frequent choice.

Loading the live Split Button…
Split ButtonDocs

Button group

Several buttons joined into one control, sharing borders. It shows that the actions belong together, such as Previous and Next, or Day, Week and Month.

Best for: related actions and pagers. Avoid when: the actions are unrelated, or one is dangerous; keep Delete away from Edit. Tip: keep a group to 2 to 5 buttons so it fits on a phone.

Loading the live Button Group…
Button GroupDocs

Toggle and toggle group

A toggle is a button that stays pressed: bold on or off, favourite or not. A toggle group lets people pick one (or several) options from a set, like text alignment or a view switcher.

Best for: formatting toolbars, view modes, filters. Avoid when: the choice is part of a form people submit; a switch, checkbox or radio group says that more clearly. Tip: the pressed state must be obvious without colour, using a fill, an inset or a check.

Loading the live Toggle Group…
Toggle GroupDocs

Copy button

A small button next to a value, such as an API key, install command or invite link, that copies it and confirms with a check mark.

Best for: anything people will paste somewhere else. Avoid when: the value is long prose. Tip: show Copied for about a second and a half, then return to the copy icon, so it can be used again.

Loading the live Copy Button…
Copy ButtonDocs

Floating action button

A floating action button (FAB) is a round button that floats in a corner of a mobile screen for the single most frequent action: compose, add, new chat.

Best for: mobile apps and mobile layouts of web apps with one dominant creation action. Avoid when: on desktop websites, or when there is more than one main action. Tip: keep it clear of the bottom navigation and the keyboard, and give it a text label when space allows.

Loading the live Floating Action Button…
Floating Action ButtonDocs

Button states every button needs

StateWhat it showsHow
DefaultIt is clickableClear fill or border, readable label
HoverThe pointer is on itSlightly darker or lighter fill
FocusKeyboard focus is on itA visible focus ring, never removed
ActiveIt is being pressedSlightly smaller or darker for a moment
LoadingThe action is runningA spinner and a disabled click, same width
DisabledIt cannot be used yetLower contrast, plus a reason nearby
Loading the live Spinner…
SpinnerA loading state inside a button.Docs

Disabled buttons with no explanation are a common source of support tickets. If the button is disabled because a field is empty, say which field, or keep the button enabled and show the error on click.

Labels, sizes and spacing

  • Labels: start with a verb and name the result: Create invoice, Send 3 reminders, Delete project. Sentence case reads faster than all caps.
  • Sizes: at least 44 by 44 pixels on touch screens; 32 to 40 pixels tall on desktop, depending on density.
  • Spacing: 8 to 12 pixels between buttons in a row, more around destructive ones.
  • Placement: keep the primary action in the same spot across the product, usually bottom right of dialogs and forms.
  • Links vs buttons: if it goes to another page, it is a link (it can look like a button); if it does something, it is a button. Screen readers announce them differently.

All the buttons above are free React components. Add the base button with npx shadcn@latest add @minidev/button, and see every variant on the button docs page.

Components used in this guide

Frequently asked questions

What are the main types of buttons in UI design?

By weight: primary, secondary, outline, ghost and destructive. By shape and job: icon buttons, split buttons, button groups, toggles and toggle groups, copy buttons and floating action buttons.

What is the difference between a primary and a secondary button?

A primary button is the filled, high-contrast button for the main action on a screen. A secondary button is visually quieter and offers an alternative, such as Cancel next to Save. Use one primary button per screen.

What is a ghost button?

A button with no background or border until it is hovered. It suits repeated, low-stakes actions in toolbars, rows and card footers, but is too easy to miss for important actions.

When should I use a split button?

When there is one common action with less common variations, such as Save with Save as draft. The main part runs the default; the arrow opens the alternatives.

Should disabled buttons be used?

Sparingly. A disabled button with no explanation leaves people stuck. Either explain why it is disabled next to it, or keep it enabled and show what is missing when it is clicked.

Is a link that looks like a button OK?

Yes. If it navigates to another page, use a link element styled as a button. If it performs an action on the current page, use a button element. The look can match; the element should follow the behaviour.

More guides