Introducing PrimeReact v11-alpha 🎉Discover Now
styledButton

Button

Button is an extension to standard input element with icons and theming.

preview

Usage#

import { Button } from '@primereact/ui/button';
import { ButtonGroup } from '@primereact/ui/buttongroup';
<ButtonGroup>
    <Button />
</ButtonGroup>

Examples#

Basic#

A standard button with label, icon, and various severity options.

basic-demo

Icons#

icon-demo

Loading#

loading-demo

Use as="a" to render a button as HTML anchor tag or use as={Link} to use Next.js Link.

link-demo

Severity#

The severity property defines the variant of a button.

severity-demo

Raised#

Raised buttons display a shadow to indicate elevation.

raised-demo

Rounded#

Rounded buttons have a circular border radius.

rounded-demo

Text#

Text buttons are displayed as textual elements.

text-demo

Raised Text#

Text buttons can be displayed elevated with the raised option.

raised-text-demo

Outlined#

Outlined buttons display a border without a transparent background.

outlined-demo

Icon Only#

Buttons can have icons without labels. Use iconOnly to display only an icon.

icon-only-demo

Badge#

Badge component can be used to display a badge inside a button. OverlayBadge is used to display a badge on a button.

badge-demo

Button Group#

Multiple buttons are grouped when wrapped inside a ButtonGroup component.

group-demo

Sizes#

Button provides small and large sizes as alternatives to the base.

size-demo

Disabled#

When disabled is present, the element cannot be used.

disabled-demo

API#

Sub-Components#

See Primitive API for ButtonRoot and ButtonGroup component documentation.

Hooks#

See Headless API for useButton hook documentation.

Accessibility#

See Button Primitive for WAI-ARIA compliance details and keyboard support.