Tag component is used to categorize content.
import { Tag } from 'primereact/tag';
<script src="https://unpkg.com/primereact/core/core.min.js"></script>
<script src="https://unpkg.com/primereact/tag/tag.min.js"></script>
Content of the tag is specified using the value property.
<Tag value="New"></Tag>
An icon can also be configured to be displayed next to the value with the icon property.
<Tag value="New" icon="pi pi-plus"></Tag>
Different color options are available as severity levels.
Content can easily be added like a child element.
<Tag>
Content
</Tag>
Any valid attribute is passed to the root element implicitly, extended properties are as follows;
Name | Type | Default | Description |
---|---|---|---|
value | any | null | Value to display inside the tag. |
severity | string | null | Severity type of the tag. |
rounded | boolean | false | Whether the corners of the tag are rounded. |
icon | string | null | Icon of the tag to display next to the value. |
Following is the list of structural style classes, for theming classes visit theming page.
Name | Element |
---|---|
p-tag | Tag element |
p-tag-rounded | Rounded element |
p-tag-icon | Icon of the tag |
p-tag-value | Value of the tag |
This section is under development. After the necessary tests and improvements are made, it will be shared with the users as soon as possible.
None.
Built-in component themes created by the PrimeReact Theme Designer.
Premium themes are only available exclusively for PrimeReact Theme Designer subscribers and therefore not included in PrimeReact core.
Beautifully crafted premium create-react-app application templates by the PrimeTek design team.