Skip to content

Button

Expressive

Five variants and five sizes for text actions, with a toggle form and a press morph.

import { Button } from '@windmorph/react';

Purpose

Buttons let people take action with a single tap. Reach for a button when the action has a short text label; use an IconButton when an icon alone is clear, and a Fab for the one primary action on a screen.

Pick a variant by emphasis: filled for the most important action, then elevated and tonal, then outlined, with text buttons for the lowest emphasis. Only one high-emphasis button should compete for attention in a given area.

Usage

  • Use one filled button per page or view, for its most important action; give the others less emphasis.
  • Keep labels short. A label never wraps or truncates, so a long one can be wider than a phone screen: at compact widths use a smaller size, a shorter label, or a ButtonGroup with overflow.
  • Keep a toggle's label about the same length in both states (Star / Starred), so the button doesn't jump in width when it changes. Pair an outlined icon with its filled form through selectedLeadingIcon.

Do and don't

Do: Use one filled button for the main action, and give the others less emphasis.
Don't: Don't crowd a view with high-emphasis buttons: move low-priority actions to an overflow menu or icon buttons.
Do: Keep a toggle button's label about the same length in both states.
Don't: Don't let the label grow or shrink a lot when the button is selected.

When not to use

For an icon-only action use an IconButton; for the single most important action on a screen use a FAB.

See also

  • Button on m3.material.io: Material's own guidelines, with anatomy and specs.
  • Icon button: A compact icon-only action; requires an accessible name.
  • Button group: Groups buttons as a unit; the connected variant replaces segmented buttons.
  • FAB: A screen's single most important action, as an icon or an extended label.