If you answer yes, we store and analyse information that helps us improve the website. You can change your choice at any time at the bottom of the page. More about what we store and why.

We also store necessary information that cannot be opted out of. This makes the website work and keeps it secure.

Skip to main content

What are you looking for?

Try searching for…

Components

Divider

Divider is used to create a visual separation. It is a simple horizontal line that spans the available width.

Press Enter to start editing
<p class="ds-paragraph">Divider er brukt for å dele opp innhold i mindre deler.</p>
<hr aria-hidden="true" class="ds-divider"/>
<p class="ds-paragraph">
  Den kan også brukes for å skille innhold som er relatert til
  hverandre.
</p>
const Preview = () => {
  return (
    <>
      <Paragraph>
        Divider er brukt for å dele opp innhold i mindre deler.
      </Paragraph>
      <Divider />
      <Paragraph>
        Den kan også brukes for å skille innhold som er relatert til hverandre.
      </Paragraph>
    </>
  );
};

render(<Preview />)

Usage

The class name ds-divider is applied directly to the <hr> element. Apply aria-hidden="true" to avoid noise in screen readers.

CSS variables and data attributes

Sizes are controlled with data-size and colors with data-color. The component will inherit from the closest parent where these are set.

CSS Variables
NameValue
--dsc-divider-border-colorvar(--ds-color-neutral-border-subtle)
--dsc-divider-border-stylesolid
--dsc-divider-border-widthvar(--ds-border-width-default)

No relevant data attributes found.

React

Edit this page on github.com (opens in a new tab)