Skip to content

Divider

<quiet-divider> stable since 1.0

Dividers separate and group content visually.

<quiet-divider></quiet-divider>

Examples Jump to heading

Changing the orientation Jump to heading

Set the orientation attribute to vertical for a vertical orientation. This is best used inside of flex containers.

First Second Third
<div style="display: flex; align-items: center; height: 2rem;">
  <span>First</span>
  <quiet-divider orientation="vertical"></quiet-divider>
  <span>Second</span>
  <quiet-divider orientation="vertical"></quiet-divider>
  <span>Third</span>
</div>

Customizing styles Jump to heading

Use the --color, --spacing, and --thickness custom properties to change how the divider looks.

<quiet-divider style="--color: royalblue; --thickness: 4px;"></quiet-divider>

API Jump to heading

Importing Jump to heading

The autoloader is the recommended way to import components but, if you prefer to do it manually, the following code snippets will be helpful.

CDN npm

To manually import <quiet-divider> from the CDN, use the following code.

import 'https://cdn.jsdelivr.net/npm/@quietui/quiet@1.0.0/dist/components/divider/divider.js';

To manually import <quiet-divider> from npm, use the following code.

import '@quietui/quiet/dist/components/divider/divider.js';

Properties Jump to heading

Divider has the following properties that can be set with corresponding attributes. In many cases, the attribute's name is the same as the property's name. If an attribute is different, it will be displayed after the property. Learn more about attributes and properties

Property / Attribute Description Reflects Type Default
orientation Sets the divider's orientation. 'horizontal'
'vertical'
'horizontal'

CSS custom properties Jump to heading

Divider supports the following CSS custom properties. You can style them like any other CSS property. Learn more about CSS custom properties

Name Description Default
--color The color of the divider. var(--quiet-neutral-stroke-soft)
--spacing The spacing around the divider. 1rem
--thickness The thickness of the divider. var(--quiet-border-width)
Search this website Toggle dark mode Get the code on GitHub Follow @quietui.org on Bluesky Follow @quiet_ui on X
    No results found