Skip to main content Sidebar
Skip to table of contents

    Tag

    <pc-tag> 0.5.1 experimental

    Tags are used as labels to organise things or to indicate a selection.

    <pc-tag>Tag</pc-tag>
    Code Edit

    Appearances#

    Use the appearance attribute to change the tag’s appearance.

    Edit

    Variants#

    Use the variant attribute to change the tag’s variant.

    Edit

    Sizes#

    Use the size attribute to change the tag’s size.

    Edit

    Pill#

    Use the pill attribute to give tags a pill‐shaped look.

    Edit

    Removable#

    Use the removable attribute to add a remove button to the tag.

    Edit

    Properties#

    NameDescriptionReflectsDefault
    appearanceThe tag’s appearance.
    Type: "primary" | "success" | "neutral" | "warning" | "danger"
    "neutral"
    variantThe tag’s variant.
    Type: "accent" | "filled" | "outlined" | "filled outlined"
    "filled outlined"
    sizeThe tag’s size.
    Type: "small" | "medium" | "large"
    "medium"
    pillDraws a pill‐style tag.
    Type: boolean
    false
    removableAdds 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 customising animations.

    Slots#

    NameDescription
    (default)The tag’s content.

    Learn more about using slots.

    Events#

    NameDescriptionEvent detail
    pc-removeEmitted when the remove button is pressed.

    Learn more about events.

    Parts#

    NameDescription
    contentThe tag’s content.
    remove-buttonThe tag’s remove button, a <pc-button>.
    remove-button-baseThe 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.

    CDN (script tag)CDN (import)npm (import)

    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.3/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.3/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:

    We’d love to hear from you. Please reach out to us with any questions or enquiries you may have.

    You can contact us via e‐mail at placer.coc.reports+contact@gmail.com.

    We look forward to hearing from you!

    Got it!
    Dangerous lands

    Whoa! You’ve wandered into the dangerous lands of Placer Toolkit. Version 0 is out of date and doesn’t meet EU privacy standards, including GDPR.

    Want the latest powers, security and compliance? Stick with the current version of Placer Toolkit!

    Yikes! Power up!