Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

Button

Button supports the seven built-in variants, custom MantiVariant strings, and a Button-only link treatment.

Set as="a" for navigation without nesting interactive elements. Native props and the ref type follow the selected root. Leading and trailing icons are decorative and render in public leading-icon / trailing-icon anatomy parts; the accessible name must come from children or aria-label.

import { Button } from '@manti-ui/react';

const variants = [
  'primary',
  'secondary',
  'tertiary',
  'danger',
  'outline',
  'link',
] as const;

export default function ButtonVariants() {
  return (
    <>
      {variants.map((variant) => (
        <Button key={variant} variant={variant}>
          {variant}
        </Button>
      ))}
    </>
  );
}

Sizes

Loading

loading blocks interaction, shows a Spinner, and preserves the button width.

API

PropTypeDefaultDescription
variantMantiVariant | 'link''primary'Color and emphasis. Supports all built-ins, custom MantiVariant strings, and the Button-only link treatment.
size'sm' | 'md' | 'lg''md'Control size.
loadingbooleanfalseShow a spinner, block interaction, and preserve width.
fullWidthbooleanfalseStretch to fill the available inline space.
iconOnlybooleanfalseRender as a square icon button. Provide an aria-label.
leadingIconReactNodeContent placed before the label.
trailingIconReactNodeContent placed after the label.
asElementType'button'Polymorphic root. Native props and ref follow the selected element.

Styling

Anatomy

PartSelectorDescription
root[data-scope="button"][data-part="root"]The <button> element.
spinner[data-scope="button"][data-part="spinner"]Loading indicator (when loading).
label[data-scope="button"][data-part="label"]Wraps icons and children.
leading-icon[data-scope="button"][data-part="leading-icon"]Decorative leading icon wrapper.
trailing-icon[data-scope="button"][data-part="trailing-icon"]Decorative trailing icon wrapper.

Tokens

TokenControls
--manti-button-radiusradius
--manti-button-heightheight
--manti-button-padding-xpadding x
--manti-button-font-sizefont size
--manti-button-gapgap
--manti-button-cursorcursor
--manti-button-bg-hoverbg hover
--manti-button-bg-activebg active

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub