Components

Separator component

The kit:separator component renders a thin horizontal or vertical dividing line.

separator.svelte
Above the separator
Below the separator
<div style="max-width: 320px; display: flex; flex-direction: column; gap: 0.75rem;">
	<span>Above the separator</span>
	<kit:separator />
	<span>Below the separator</span>
</div>

kit:separator renders as <hr> by default, which is a separator natively; with is="div" it sets role="separator". aria-orientation is set automatically. The color (--kit-color-border) and the thickness can be overridden per-instance with color and thickness, or globally with the --kit-separator-color and --kit-separator-thickness variables.

Examples of separator

orientation

  • orientation: 'horizontal' | 'vertical' = 'horizontal'

Vertical separators are inline-flex and stretch to fill their container’s height.

separator.svelte
<div style="display: flex; align-items: center; gap: 1rem; height: 2.5rem;">
	<span>Home</span>
	<kit:separator orientation="vertical" />
	<span>About</span>
	<kit:separator orientation="vertical" />
	<span>Contact</span>
</div>

inset

Adds a leading margin to indent the separator from the left edge useful inside lists.

  • inset: boolean = false
separator.svelte
<div style="max-width: 320px;">
	<div style="padding: 0.75rem 1rem;">Item one</div>
	<kit:separator inset />
	<div style="padding: 0.75rem 1rem;">Item two</div>
	<kit:separator inset />
	<div style="padding: 0.75rem 1rem;">Item three</div>
</div>

Without preprocess Lapikit

If you aren’t using the Lapikit preprocessor in svelte.config.js, import the components directly:

import { Separator } from 'lapikit/components';

API Reference

kit:separator

propstypedescriptiondefault
ref $bindableHTMLElementBindable reference to the rendered DOM element.null
isenum'div''hr'HTML element to render.'hr'
classstring | array | objectClasses of the separator, with the rules of Svelte (clsx).
stylestringInline style of the separator.
s-classstring | array | objectClasses of the separator, merged with class.
s-styleobjectInline style as an object of property / value pairs.
orientationenum'horizontal''vertical'Direction of the separator.'horizontal'
insetbooleanAdds a leading indent.false
thicknessstring | numberBorder width: a number in px or a CSS width (--kit-separator-thickness).'thin'
colorstring | falseA color of the palette or any CSS color (--kit-separator-color).

To organize your data, combine Separators with List for greater legibility.