Skip to main content Sidebar
Skip to table of contents

    Dropdown Item

    <pc-dropdown-item> 1.0.0-alpha.1 experimental

    Represents an individual item within a dropdown menu, supporting standard items, checkboxes and submenus.

    This component must be used as a child of <pc-dropdown>. Additional demonstrations can be found in the dropdown demos.

    Properties#

    NameDescriptionReflectsDefault
    appearanceThe type of menu item to render.
    Type: "default" | "primary" | "success" | "warning" | "danger"
    "default"
    valueAn optional value for the menu item. This is useful for determining which item was selected when listening to the dropdown’s pc-select event.
    Type: string | undefined
    typeThe dropdown item’s type.
    Type: "normal" | "checkbox"
    "normal"
    checkedSet to true to check the dropdown item by default. This is only valid when the type attribute/property is set to checkbox.
    Type: boolean
    false
    disabledDisables the dropdown item.
    Type: boolean
    false
    submenuOpenDecides whether the submenu is currently open.
    Type: boolean
    false
    updateComplete A read‐only promise that resolves when the component has finished updating.

    Learn more about attributes and properties.

    Slots#

    NameDescription
    (default)The dropdown item’s label.
    iconAn optional icon to display before the label.
    detailsAdditional content or details to display after the label.
    submenuSubmenu items, typically <pc-dropdown-item> elements, to create a nested menu.

    Learn more about using slots.

    Methods#

    NameDescriptionArguments
    openSubmenu()Opens the submenu.
    closeSubmenu()Closes the submenu.

    Learn more about methods.

    Events#

    NameDescriptionEvent detail
    pc-focusEmitted when the dropdown item gains focus.
    pc-blurEmitted when the dropdown item loses focus.

    Learn more about events.

    Parts#

    NameDescription
    checkmarkThe checkmark icon (a <pc-icon> element) when the item is a checkbox.
    checkmark-svgThe svg part in the checkmark’s <pc-icon> element.
    iconThe container for the icon slot.
    labelThe container for the label slot.
    detailsThe container for the details slot.
    submenu-iconThe submenu indicator icon (a <pc-icon> element).
    submenu-icon-svgThe svg part in the submenu icon’s <pc-icon> element.
    submenuThe submenu container.

    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/dropdown-item/dropdown-item.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/dropdown-item/dropdown-item.js";

    To manually import this component from npm, copy this code snippet and paste it in your JavaScript file.

    import "placer-toolkit/dist/components/dropdown-item/dropdown-item.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!