Introducing PrimeReact v11-alpha 🎉Discover Now

Button

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

preview

Installation#

npx shadcn@latest add @primereact/button

Usage#

import { Button } from '@/components/ui';
<Button>Button</Button>

Examples#

Basic#

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

Disabled#

When disabled is present, the element cannot be used.

disabled-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 an element with Button.Group component.

group-demo

Sizes#

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

size-demo