Divider

A horizontal line between blocks of content.

Installation

Import the class, and @use the entry point in your global styles: without it the component renders unstyled.

import { Component } from '@angular/core';
import { WrDivider } from 'ngwr/divider';

@Component({ imports: [WrDivider] })
export class MyComponent {}

Basic usage

<wr-divider />

Line styles

<wr-divider type="solid" />
<wr-divider type="dashed" />
<wr-divider type="dotted" />

Colors

<wr-divider color="primary" />
<wr-divider color="success" />

Width

<wr-divider [width]="3" color="primary" />

With label

Put text inside to label the line; align moves it to the start or end.

ORSectionFootnotes
<wr-divider>OR</wr-divider>
<wr-divider align="start">Section</wr-divider>
<wr-divider align="end" type="dashed">Footnotes</wr-divider>

Long label

A long label wraps, and the line stays on both sides.

Continued from the previous chapter — see appendix B for derivations
<wr-divider>Continued from the previous chapter — see appendix B for derivations</wr-divider>

API

NameDescriptionTypeDefault
colorColor of the divider line. Omit for the neutral default.WrColor | nullnull
typeLine style.WrDividerType'solid'
widthLine width in pixels.number1
alignLabel position. Only meaningful when the divider has projected content — otherwise the line is symmetric and alignment has no visible effect.WrDividerAlign'center'

CSS variables

Set these on the component's selector or a wrapper, not on :root: the defaults are declared on ngwr/divider's own element.

VariableDefaultDeclared on
--wr-divider-aside1rem.wr-divider
--wr-divider-colorvar(--wr-border-base).wr-divider +1 variant override
--wr-divider-font-sizevar(--wr-text-sm).wr-divider
--wr-divider-gapvar(--wr-space-md).wr-divider
--wr-divider-line-heightvar(--wr-text-sm-leading).wr-divider
--wr-divider-stylesolid.wr-divider +2 variant overrides
--wr-divider-width1px.wr-divider

See also