CSC Design System v4
VueFlavour Vue React Angular TypeScriptPrimaryCSC UI ColorsPrimarySecondaryAccentCustom ColorsRedOrangeGreenBluePurplePink
Guides Getting started Customization Data visualization Migration guide Componentsc-accordionc-alertc-autocompletec-badgec-breadcrumbc-buttonc-button-groupc-cardc-checkboxc-color-pickerc-csc-logoc-data-tablec-date-pickerc-dividerc-file-uploadc-iconc-icon-buttonc-linkc-listc-loaderc-login-buttonsc-login-cardc-mainc-menuc-messagec-modalc-navigation-buttonc-number-fieldc-otp-inputc-pagec-paginationc-popoverc-progress-barc-progress-circlec-radio-groupc-selectc-side-navigationc-sliderc-spinnerc-statusc-stepsc-switchc-tablec-tabsc-tagsc-text-fieldc-time-pickerc-toastsc-toolbarc-tooltipc-tree-select

<c-divider>

A separator: a thin line dividing groups of content, horizontal by default or vertical with `vertical`.

Usage

When to use

  • Between groups of items in a c-menu, slotted among its c-menu-item elements. A c-menu-label heads a group; the separator is the line between groups.
  • Between sections of a card or panel, or between items in a row.
  • Not for spacing alone: it always draws a line.

Orientation

A horizontal separator is a block spanning the full width of its container, with a small margin above and below. A vertical one is an inline-block with a small margin on each side: in a flex row it stretches to the row's height, and in running text it is at least 1em tall.

Accessibility

The line is a role="separator" element whose aria-orientation follows vertical. It is not focusable; screen readers may announce it, which in a menu marks the boundary between groups.

Customization

::part(root) is the line itself. It paints the divider token, a translucent ink that reads on every surface in both theme modes, as its background colour, so set background-color to recolour it and margin to change its spacing:

c-divider::part(root) {
  margin-block: 16px;
}

Examples

Basic
Vue React Angular TypeScript
<template>
  <div>
    <p>Profile</p>

    <c-divider />

    <p>Preferences</p>
  </div>
</template>
Vertical
Vue React Angular TypeScript
<template>
  <div class="example-row">
    <span>Details</span>

    <c-divider vertical />

    <span>Members</span>

    <c-divider vertical />

    <span>Settings</span>
  </div>
</template>

API reference

<c-divider>

A separator: a thin line dividing groups of content, horizontal by default or vertical with `vertical`.

Properties

PropertyAttributeTypeDefaultDescription
verticalverticalbooleanfalse Render a vertical separator instead of the default horizontal one.

CSS parts

Style from outside with c-divider::part(name) — parts are the library's only styling customization API.

PartDescription
rootThe separator line element itself