Button

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

Text to display on a button is defined with the label property.

Text to display on a button is defined with the label property.

basic-demo

Button can also be used as directive using pButton along with pButtonLabel and pButtonIcon helper directives.

directive-demo

A button can be rendered as a link when link property is present, while the pButton directive can be applied on an anchor element to style the link as a button.

Icon of a button is specified with icon property and position is configured using iconPos attribute.

icons-demo

Busy state is controlled with the loading property.

loading-demo

Severity defines the type of button.

severity-demo

When disabled is present, the element cannot be edited and focused.

disabled-demo

Raised buttons display a shadow to indicate elevation.

raised-demo

Rounded buttons have a circular border radius.

rounded-demo

Text buttons are displayed as textual elements.

text-demo

Text buttons can be displayed as raised for elevation.

raised-text-demo

Outlined buttons display a border without a background initially.

outlined-demo

Buttons can have icons without labels.

icons-only-demo

Buttons have built-in badge support with badge and badgeClass properties.

badge-demo

Multiple buttons are grouped when wrapped inside an element with ButtonGroup component.

button-group-demo

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

sizes-demo

Custom content inside a button is defined as children.

template-demo

Screen Reader

Button component renders a native button element that implicitly includes any passed prop. Text to describe the button is defined with the aria-label prop, if not present label prop is used as the value. If the button is icon only or custom templating is used, it is recommended to use aria-label so that screen readers would be able to read the element properly.

Keyboard Support

KeyFunction
tabMoves focus to the button.
enterActivates the button.
spaceActivates the button.
ON THIS PAGE
PrimeBlocks
490+ ready to use UI blocks crafted with PrimeNG and Tailwind CSS.
Learn More