Компоненты PrimeNG
Button

Кнопки

PrimeNG/Button (opens in a new tab)

Кнопка - это расширение к стандартному HTML-тегу с пиктограммами и возможностью темизации.

С чего начать

Подключите модуль

import { ButtonModule } from 'primeng/button';

Встройте компонент с помощью тэга p-button.

Basic

Icons

Severities

Raised Buttons

Rounded Buttons

Text Buttons

Raised Text Buttons

Outlined Buttons

Rounded Icon Buttons

Rounded Text Icon Buttons

Rounded and Outlined Icon Buttons

Badges

Templating

PrimeNG

Button Set

Размеры

Размеры для кнопок с иконкой

Использование p-button с q-icon

Директива

Если Вы хотите использовать кнопку от prime как директиву в сочетании с иконкой qpalette, то для корректного отображения кнопки необходимо обязательно использовать классp-button-icon-only.

Компонент

Если Вы хотите использовать кнопку от prime как компонент в сочетании с иконкой qpalette, то для корректного отображения кнопки необходимо обязательно использовать styleClassp-button-q-icon.

Свойства pButton

NameTypeDefaultDescription
labelstringnullText of the button.
iconstringnullName of the icon.
iconPosstringleftPosition of the icon, valid values are "left" and "right".
loadingbooleanfalseWhether the button is in loading state.
loadingIconstringpi pi-spinner pi-spinIcon to display in loading state.

Свойства p-button

NameTypeDefaultDescription
typestringnullType of the button.
labelstringnullText of the button.
iconstringnullName of the icon.
iconPosstringleftPosition of the icon, valid values are "left" and "right".
badgestringnullValue of the badge.
badgeClassstringnullStyle class of the badge.
loadingbooleanfalseWhether the button is in loading state.
loadingIconstringpi pi-spinner pi-spinIcon to display in loading state.
disabledbooleanfalseWhen present, it specifies that the component should be disabled.
stylestringnullInline style of the element.
styleClassstringnullStyle class of the element.
onClickeventnullCallback to execute when button is clicked.
onFocuseventnullCallback to execute when button is focused.
onBlureventnullCallback to execute when button loses focus.

Шаблоны

NameParameters
content-

Стилизация

NameElement
p-buttonButton element
p-button-iconIcon element
p-button-labelLabel element of the button