Separator component
The kit:separator component renders a thin horizontal or vertical dividing line.
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.
<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
<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
| props | type | description | default |
|---|---|---|---|
| ref $bindable | HTMLElement | Bindable reference to the rendered DOM element. | null |
| is | enum'div''hr' | HTML element to render. | 'hr' |
| class | string | array | object | Classes of the separator, with the rules of Svelte (clsx). | |
| style | string | Inline style of the separator. | |
| s-class | string | array | object | Classes of the separator, merged with class. | |
| s-style | object | Inline style as an object of property / value pairs. | |
| orientation | enum'horizontal''vertical' | Direction of the separator. | 'horizontal' |
| inset | boolean | Adds a leading indent. | false |
| thickness | string | number | Border width: a number in px or a CSS width (--kit-separator-thickness). | 'thin' |
| color | string | false | A color of the palette or any CSS color (--kit-separator-color). |
To organize your data, combine Separators with List for greater legibility.
