Skip to main content Design tokens Components Style utilities
Skip to table of contents

    Divider

    Dividers are used to visually separate or group elements.

    <pc-divider></pc-divider>
    Code

    Demos

    Stroke width

    Use the --stroke-width custom property to change the stroke width of the divider.

    Colour

    Use the --color custom property to change the colour of the divider.

    Spacing

    Use the --spacing custom property to change the amount of space between the divider and its neighbouring elements.

    Vertical

    Add the vertical attribute to draw the divider in a vertical orientation. The divider will span the full height of its container. Vertical dividers work especially well inside of a flex container.

    Use dividers in menus to visually group menu items.

    Properties

    NameDescriptionReflectsDefault
    verticalVertically orientates the divider. booleanfalse
    updateComplete A read‐only promise that resolves when the component has finished updating. -

    Learn more about attributes and properties.

    Custom properties

    NameDescriptionDefault
    --colorThe colour of the divider.-
    --stroke-widthThe stroke width of the divider line.-
    --spacingThe spacing of the divider.-

    Learn more about customising custom properties.

    Importing

    If you’re using the autoloader or the standard loader, you can ignore this section. If you’re cherry picking, you can use any of the following snippets to import this component.

    ScriptImportBundler

    To import this component from the CDN with a script tag, copy this snippet and paste it in your HTML.

    <script type="module" src="https://cdn.jsdelivr.net/npm/placer-toolkit@0.5.1/dist/components/divider/divider.js"></script>

    To import this component from the CDN using a JavaScript import, copy this snippet and paste it in your JavaScript:

    import "https://cdn.jsdelivr.net/npm/placer-toolkit@0.5.1/dist/components/divider/divider.js";

    To import this component with a bundler using a JavaScript import, copy this snippet and paste it in your JavaScript:

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