Zum Hauptinhalt springen Seitenleiste
Zum Inhaltsverzeichnis springen

    Card

    <pc-card> 0.1.0 experimental

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

    Cards can be used to group related subjects in a container.

    <pc-card class="card-overview">
        <img
            slot="media"
            src="https://placehold.co/300x200/?text=300×200&font=montserrat"
            alt="A placeholder image with grey background and dark grey text in resolution 300 by 200 pixels"
        />
    
        <strong slot="header">Lorem ipsum</strong>
    
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
        eiusmod tempor incididunt ut labore et dolore magna aliqua.
    
        <footer slot="footer">
            <pc-button appearance="primary" pill>
                <pc-icon
                    library="default"
                    icon-style="solid"
                    name="cart-shopping"
                    slot="prefix"
                ></pc-icon>
                Buy
            </pc-button>
    
            <pc-dropdown placement="bottom-end">
                <pc-button appearance="neutral" variant="plain" slot="trigger" pill>
                    <pc-icon
                        library="default"
                        icon-style="solid"
                        name="ellipsis"
                        label="More information"
                    ></pc-icon>
                </pc-button>
    
                <pc-dropdown-item value="view-details">
                    <pc-icon
                        library="default"
                        icon-style="solid"
                        name="circle-info"
                        slot="icon"
                    ></pc-icon>
                    View details
                </pc-dropdown-item>
                <pc-dropdown-item value="favourite">
                    <pc-icon
                        library="default"
                        icon-style="solid"
                        name="heart"
                        slot="icon"
                    ></pc-icon>
                    Favourite
                </pc-dropdown-item>
                <pc-dropdown-item value="share">
                    <pc-icon
                        library="default"
                        icon-style="solid"
                        name="share-nodes"
                        slot="icon"
                    ></pc-icon>
                    Share
                </pc-dropdown-item>
                <pc-dropdown-item value="compare">
                    <pc-icon
                        library="default"
                        icon-style="solid"
                        name="scale-balanced"
                        slot="icon"
                    ></pc-icon>
                    Compare
                </pc-dropdown-item>
            </pc-dropdown>
        </footer>
    </pc-card>
    
    <style>
        .card-overview {
            max-inline-size: 300px;
        }
    
        .card-overview footer {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: var(--pc-spacing-s);
        }
    </style>
    Code Edit

    Demos#

    Basic card#

    Basic cards aren’t very exciting, but they can display any content you want them to.

    Edit

    With header#

    Headers can be used to display titles and more.

    Edit

    Footers can be used to display actions, summaries or other relevant content.

    Edit

    Media#

    Cards accept a media slot. The media is displayed at the top of the card and stretches to fit.

    Edit

    Variants#

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

    Edit

    Eigenschaften#

    NameBeschreibungReflektiertStandard
    variantThe card’s variant.
    Typ: "accent" | "filled" | "outlined" | "plain"
    "outlined"
    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 card’s main content.
    mediaAn optional media section to render at the start of the card.
    headerAn optional header for the card.
    footerAn optional footer for the card.

    Erfahre mehr über die Benutzung von Slots.

    Benutzerdefinierte Eigenschaften#

    NameBeschreibungStandard
    --spacingThe amount of space around and between sections of the card.var(--pc-spacing-l)

    Erfahre mehr über das Anpassen von benutzerdefinierten Eigenschaften.

    Parts#

    NameBeschreibung
    baseThe component’s base wrapper.
    mediaThe container that wraps the card’s media.
    headerThe container that wraps the card’s header.
    bodyThe container that wraps the card’s main content.
    footerThe container that wraps the card’s footer.

    Erfahre mehr über das Anpassen von CSS‐Parts.

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

    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!