Details
<pc-details> 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">
This section contains additional details that are hidden by default. Use details to progressively disclose content that isn’t required immediately, such as explanations, hints or secondary settings.
</pc-details> Use the variant attribute to change the details’ variant.
Use the disabled attribute to prevent the details from expanding.
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.
To use HTML in the summary, use the summary slot. Links and other interactive elements will still retain their behaviour.
The details component automatically adapts to RTL languages with the lang and dir attributes.
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.
| Name | Beschreibung | Reflektiert | Standard |
|---|---|---|---|
open | Indicates 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 |
summary | The summary to show in the header. If you need to display HTML, use the summary slot instead.Typ: string | undefined |
| ‐ |
variant | The details’ variant. Typ: "filled" | "outlined" | "plain" |
| "outlined" |
disabled | Disables 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.
| Name | Beschreibung |
|---|---|
| (Standard) | The details’ main content. |
summary | The details’ summary. Alternatively, you can use the summary attribute. |
expand-icon | An optional expand icon to use instead of the default. Works best with <pc-icon>. |
collapse-icon | An optional collapse icon to use instead of the default. Works best with <pc-icon>. |
Erfahre mehr über die Benutzung von Slots.
| Name | Beschreibung | Argumente |
|---|---|---|
show() | Shows the details. | ‐ |
hide() | Hides the details. | ‐ |
Erfahre mehr über Methoden.
| Name | Beschreibung | Event‐Detail |
|---|---|---|
pc-show | Emitted when the details opens. | ‐ |
pc-after-show | Emitted after the details opens and all animations are complete. | ‐ |
pc-hide | Emitted when the details closes. | ‐ |
pc-after-hide | Emitted after the details closes and all animations are complete. | ‐ |
Erfahre mehr über Events.
| Name | Beschreibung |
|---|---|
base | The component’s base wrapper. |
header | The header that wraps both the summary and the expand/collapse icon. |
summary | The container that wraps the summary. |
summary-icon | The container that wraps the expand/collapse icons. |
body | The container of the details’ content. |
content | The details’ content. |
Erfahre mehr über das Anpassen von CSS‐Parts.
| Name | Beschreibung |
|---|---|
details.show | The animation to use when showing details. You can use both height: auto and block-size: auto with this animation. |
details.hide | The 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.
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.
Um diese Komponente manuell vom CDN zu importieren, kannst du dieses Code‐Snippet kopieren und es in dein HTML einfügen.
<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, kannst du dieses Code‐Snippet kopieren und es in deine JavaScript‐Datei einfügen.
import "https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.3/cdn/components/details/details.js"; Um diese Komponente manuell von npm zu importieren, kannst du dieses Code‐Snippet kopieren und es in deine JavaScript‐Datei einfügen.
import "placer-toolkit/dist/components/details/details.js"; Diese Komponente importiert automatisch folgende Komponenten: