enes

Divider

The Divider component is used to visually separate content within a layout. It can be oriented horizontally or vertically.

Usage

<script>
  import { Divider } from 'fluentui-svelte';
</script>

<Divider>Divider</Divider>

Divider API

A brief explanation of the props that really need explaining. You can see the rest of the props here.

Appearance

Controls the color of the divider. Possible values: `'standard'`, `'accent'`, `'subtle'`.

Vertical

When `vertical` is set, the divider renders on the vertical axis instead of the horizontal one. Make sure the parent container has a defined height so the divider is visible.

Align Content

The `alignContent` prop controls where the label content (children) is positioned along the divider. Possible values: `'start'`, `'center'`, `'end'`.

It also works combined with the `vertical` prop:

Inset

When `inset` is set, the divider gets some inline padding applied, useful when it's placed inside a container that has content touching its edges.

Custom element

The `as` prop lets you change the underlying HTML element rendered by the divider. Possible values: `'div'`, `'hr'`, `'span'`.

Divider Props

NameTypeDescription
asstringThe HTML element to render the divider as. Possible values: `'div'`, `'hr'`, `'span'`.
verticalbooleanWhether the divider is rendered vertically instead of horizontally.
alignContentstringThe alignment of the content within the divider. Possible values: `'start'`, `'center'`, `'end'`.
appearancestringThe appearance of the divider. Possible values: `'default'`, `'accent'`, `'standard'`, `'subtle'`.
insetbooleanWhether the divider has inline padding applied.
refHTMLDivElement | HTMLHRElement | HTMLSpanElementThe DOM reference of the divider element, its type depends on the `as` prop.
childrenSnippetThe content to render as a label within the divider.