Zum Hauptinhalt springen Seitenleiste
Zum Inhaltsverzeichnis springen

    Dropdown Item

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

    Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

    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:

    Wir würden uns freuen, von dir zu hören. Bitte kontaktiere uns bei Fragen oder Anliegen, die du hast.

    Du kannst uns per E‐Mail unter placer.coc.reports+contact@gmail.com erreichen.

    Wir freuen uns darauf, von dir zu hören!

    Alles klar!
    Gefährliche Lande

    Ui! Du bist in die gefährlichen Lande von Placer Toolkit geraten. Version 0 ist veraltet und entspricht nicht den EU‐Datenschutzstandards, einschließlich DSGVO.

    Willst du die neuesten Kräfte, Sicherheit und Compliance? Bleib bei der aktuellen Version von Placer Toolkit!

    Ups! Aufladen!