Zum Hauptinhalt springen Seitenleiste
Zum Inhaltsverzeichnis springen

    Details

    <pc-details> 0.5.1 experimental

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

    Details show a brief summary and expand to show additional content.

    <pc-details summary="Toggle me">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    </pc-details>
    Code Edit

    Demos#

    Variants#

    Use the variant attribute to change the details’ variant.

    Edit

    Disabled#

    Use the disabled attribute to prevent the details from expanding.

    Edit

    Customise the summary icon#

    Use the expand-icon and collapse-icon slots to change the expand and collapse icons, respectively. To disable the animation, override the rotate property on the summary-icon part as shown below.

    Edit

    HTML in summary#

    To use HTML in the summary, use the summary slot. Links and other interactive elements will still retain their behaviour.

    Edit

    RTL language support#

    The details component automatically adapts to RTL languages with the lang and dir attributes.

    Edit

    Group details#

    Details are designed to function independently, but you can simulate a group or “accordion” where only one is shown at a time by listening for the pc-show event.

    Edit

    Eigenschaften#

    NameBeschreibungReflektiertStandard
    openIndicates whether or not the details is open. You can toggle this attribute to show and hide the details, or you can use the show() or hide() methods and this attribute will reflect the details’ open state.
    Typ: boolean
    false
    summaryThe summary to show in the header. If you need to display HTML, use the summary slot instead.
    Typ: string | undefined
    variantThe details’ variant.
    Typ: "filled" | "outlined" | "plain"
    "outlined"
    disabledDisables the details so it can’t be toggled.
    Typ: boolean
    false
    updateComplete Ein schreibgeschütztes Promise, das erfüllt ist, sobald die Komponente fertig aktualisiert wurde.

    Erfahre mehr über Attribute und Eigenschaften.

    Slots#

    NameBeschreibung
    (default)The details’ main content.
    summaryThe details’ summary. Alternatively, you can use the summary attribute.
    expand-iconAn optional expand icon to use instead of the default. Works best with <pc-icon>.
    collapse-iconAn optional collapse icon to use instead of the default. Works best with <pc-icon>.

    Erfahre mehr über die Benutzung von Slots.

    Methoden#

    NameBeschreibungArgumente
    show()Shows the details.
    hide()Hides the details.

    Erfahre mehr über Methoden.

    Events#

    NameBeschreibungEvent‐Detail
    pc-showEmitted when the details opens.
    pc-after-showEmitted after the details opens and all animations are complete.
    pc-hideEmitted when the details closes.
    pc-after-hideEmitted after the details closes and all animations are complete.

    Erfahre mehr über Events.

    Parts#

    NameBeschreibung
    baseThe component’s base wrapper.
    headerThe header that wraps both the summary and the expand/collapse icon.
    summaryThe container that wraps the summary.
    summary-iconThe container that wraps the expand/collapse icons.
    contentThe details’ content.

    Erfahre mehr über das Anpassen von CSS‐Parts.

    Animationen#

    NameBeschreibung
    details.showThe animation to use when showing details. You can use both height: auto and block-size: auto with this animation.
    details.hideThe animation to use when hiding details. You can use height: auto and block-size: auto with this animation.

    Erfahre mehr über das Anpassen von Animationen.

    Importieren#

    Wenn du den Autoloader oder den Standard‐Loader nutzt, kannst du diesen Abschnitt überspringen. Falls du „Cherry Picking“ betreibst, kannst du die folgenden Snippets verwenden, um diese Komponente zu importieren.

    CDN (Skript‐Tag)CDN (Import)npm (Import)

    Um diese Komponente manuell vom CDN zu importieren, kopiere dieses Code‐Snippet und füge es in dein HTML ein.

    <script type="module" src="https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.3/cdn/components/details/details.js"></script>

    Um diese Komponente manuell vom CDN zu importieren, kopiere dieses Code‐Snippet und füge es in deine JavaScript‐Datei ein.

    import "https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.3/cdn/components/details/details.js";

    Um diese Komponente manuell via npm zu importieren, kopiere dieses Code‐Snippet und füge es in deine JavaScript‐Datei ein.

    import "placer-toolkit/dist/components/details/details.js";

    Abhängigkeiten#

    Diese Komponente importiert automatisch folgende Komponenten:

    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!