Zum Hauptinhalt springen Seitenleiste
Zum Inhaltsverzeichnis springen

    Scroller

    <pc-scroller> 1.0.0-alpha.1 experimental

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

    Scrollers create an accessible container while providing visual cues that help users and navigate.

    <pc-scroller class="scroller-overview">
        <table>
            <thead>
                <tr>
                    <th>Party role</th>
                    <th>Combat style</th>
                    <th>Group size</th>
                    <th>Campaign setting</th>
                    <th>Signature traits</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Warrior</td>
                    <td>Melee Tank</td>
                    <td>1–2</td>
                    <td>Forgotten Realms</td>
                    <td>Plate‐armored swordmaster who taunts foes.</td>
                </tr>
                <tr>
                    <td>Rogue</td>
                    <td>Stealth Striker</td>
                    <td>1</td>
                    <td>Eberron</td>
                    <td>Shadowy lockpick with daggers and a secret gold stash.</td>
                </tr>
                <tr>
                    <td>Wizard</td>
                    <td>Spell Slinger</td>
                    <td>1</td>
                    <td>Greyhawk</td>
                    <td>Robe‐clad mage hurling fireballs from a messy spellbook.</td>
                </tr>
                <tr>
                    <td>Cleric</td>
                    <td>Divine Support</td>
                    <td>1</td>
                    <td>Ravnica</td>
                    <td>Holy healer with a glowing amulet and sneaky ale habit.</td>
                </tr>
                <tr>
                    <td>Bard</td>
                    <td>Charisma King</td>
                    <td>1</td>
                    <td>Dragonlance</td>
                    <td>Lute‐playing charmer with magical songs and bad puns.</td>
                </tr>
            </tbody>
        </table>
    </pc-scroller>
    
    <style>
        .scroller-overview table {
            margin-block: 0;
        }
    
        .scroller-overview th,
        .scroller-overview td {
            white-space: nowrap;
        }
    
        .scroller-overview th:nth-child(5),
        .scroller-overview td:nth-child(5) {
            min-inline-size: 50ch;
            white-space: wrap;
        }
    </style>
    Code Edit

    Demos#

    Adding content#

    The scroller component automatically provides a scrollable container for any content that exceeds the available space. Simply add your content as children of the <pc-scroller> element and it will handle the rest.

    Edit

    Orientation#

    Set the orientation attribute to vertical and provide a height to create a vertical scroller.

    Edit

    No shadow#

    Use the no-shadow attribute to remove the fading shadow effect at the edges of the scroller.

    Edit

    No scrollbar#

    Use the no-scrollbar attribute to hide the scrollbar while maintaining scroll functionality. This creates a cleaner visual appearance but may reduce usability on content that needs a clear scrolling indicator.

    Edit

    Hiding scrollbars can negatively impact accessibility. Users who rely on visible scrollbars to navigate content may have difficulty recognising that content is scrollable or controlling their scroll position. Consider the needs of all users when implementing this option.

    Eigenschaften#

    NameBeschreibungReflektiertStandard
    orientationThe scroller’s orientation.
    Typ: "horizontal" | "vertical"
    "horizontal"
    noScrollbar
    no-scrollbar
    Removes the visible scrollbar.
    Typ: boolean
    false
    noShadow
    no-shadow
    Removes the shadow.
    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 content to show inside the scroller.

    Erfahre mehr über die Benutzung von Slots.

    Benutzerdefinierte Eigenschaften#

    NameBeschreibungStandard
    --shadow-colorThe base colour of the shadow.var(--pc-color-surface-default)
    --shadow-sizeThe size of the shadow.2rem

    Erfahre mehr über das Anpassen von benutzerdefinierten Eigenschaften.

    Parts#

    NameBeschreibung
    contentThe container that wraps the slotted content.

    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/scroller/scroller.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/scroller/scroller.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/scroller/scroller.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!