The Placer Toolkit alpha has
arrived! 🎉
Plenty of changes are coming your
way—some big, some breaking, some
even nuclear! Beware the changelog…
Tag
<pc-tag> Tags are used as labels to organise things or to indicate a selection.
<pc-tag>Tag</pc-tag> Appearances#
Use the appearance attribute to change the tag’s appearance.
Variants#
Use the variant attribute to change the tag’s variant.
Sizes#
Use the size attribute to change the tag’s size.
Pill#
Use the pill attribute to give tags a pill‐shaped look.
Removable#
Use the removable attribute to add a remove button to the tag.
Properties#
| Name | Description | Reflects | Default |
|---|---|---|---|
appearance | The tag’s appearance. Type: "primary"
| "success"
| "neutral"
| "warning"
| "danger" |
| "neutral" |
variant | The tag’s variant. Type: "accent"
| "filled"
| "outlined"
| "filled outlined" |
| "filled outlined" |
size | The tag’s size. Type: "small" | "medium" | "large" |
| "medium" |
pill | Draws a pill‐style tag. Type: boolean |
| false |
removable | Adds a remove button to the tag. Type: boolean |
| false |
updateComplete | A read‐only promise that resolves when the component has finished updating. | ‐ |
Learn more about attributes and properties.
Slots#
| Name | Description |
|---|---|
| (default) | The tag’s content. |
Learn more about using slots.
Events#
| Name | Description | Event detail |
|---|---|---|
pc-remove | Emitted when the remove button is pressed. | ‐ |
Learn more about events.
Parts#
| Name | Description |
|---|---|
content | The tag’s content. |
remove-button | The tag’s remove button, a <pc-button>. |
remove-button-base | The remove button’s base part. |
Learn more about customising CSS parts.
Importing#
If you’re using the autoloader or the standard loader, you can skip this section. But if you’re cherry picking, you can use any of the following snippets to import this component.
To manually import this component from the CDN, copy this code snippet and paste it in your HTML.
<script type="module" src="https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.1/cdn/components/tag/tag.js"></script> To manually import this component from the CDN, copy this code snippet and paste it in your JavaScript file.
import "https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.1/cdn/components/tag/tag.js"; To manually import this component from npm, copy this code snippet and paste it in your JavaScript file.
import "placer-toolkit/dist/components/tag/tag.js"; Dependencies#
This component automatically imports these components: