Horizontal or vertical dividing line, decorative by default, with an optional label in the middle such as "or".
MarkasUI
Components for Blade, React, and Vue.
MarkasUI
Components for Blade, React, and Vue.
MarkasUI
Components for Blade, React, and Vue.
MarkasUI
Components for Blade, React, and Vue.
MarkasUI
Components for Blade, React, and Vue.
<div class="rounded-xl border border-line bg-surface p-4 text-ink">
<p class="text-sm font-medium">MarkasUI</p>
<p class="text-sm text-muted">Components for Blade, React, and Vue.</p>
<x-markas.separator class="my-4" />
<div class="flex h-5 items-center gap-3 text-sm">
<span>Docs</span>
<x-markas.separator orientation="vertical" />
<span>Components</span>
<x-markas.separator orientation="vertical" />
<span>Changelog</span>
</div>
</div>Examples
With label
<div class="space-y-4 rounded-xl border border-line bg-surface p-4">
<x-markas.button variant="secondary" class="w-full">Continue with GitHub</x-markas.button>
<x-markas.separator label="or" />
<x-markas.input type="email" label="Email" placeholder="you@example.com" />
</div><script lang="ts">
import Button from "$lib/components/markas/Button.svelte";
import Input from "$lib/components/markas/Input.svelte";
import Separator from "$lib/components/markas/Separator.svelte";
</script>
<div class="space-y-4 rounded-xl border border-line bg-surface p-4">
<Button variant="secondary" class="w-full">Continue with GitHub</Button>
<Separator label="or" />
<Input type="email" label="Email" placeholder="you@example.com" />
</div>---
import Button from "@/components/markas/Button.astro";
import Input from "@/components/markas/Input.astro";
import Separator from "@/components/markas/Separator.astro";
---
<div class="space-y-4 rounded-xl border border-line bg-surface p-4">
<Button variant="secondary" class="w-full">Continue with GitHub</Button>
<Separator label="or" />
<Input type="email" label="Email" placeholder="you@example.com" />
</div>In a toolbar
<div class="inline-flex items-center gap-1 rounded-lg border border-line bg-surface p-1">
<x-markas.button variant="ghost" size="sm">Bold</x-markas.button>
<x-markas.button variant="ghost" size="sm">Italic</x-markas.button>
<x-markas.separator orientation="vertical" class="mx-1 my-1" />
<x-markas.button variant="ghost" size="sm">Link</x-markas.button>
<x-markas.button variant="ghost" size="sm">Image</x-markas.button>
<x-markas.separator orientation="vertical" class="mx-1 my-1" />
<x-markas.button variant="ghost" size="sm">Undo</x-markas.button>
</div>Between sections
Profile
Your name and photo are visible to your team.
Notifications
Email me when someone mentions me.
Delete account
This removes all your projects for good.
Profile
Your name and photo are visible to your team.
Notifications
Email me when someone mentions me.
Delete account
This removes all your projects for good.
Profile
Your name and photo are visible to your team.
Notifications
Email me when someone mentions me.
Delete account
This removes all your projects for good.
Profile
Your name and photo are visible to your team.
Notifications
Email me when someone mentions me.
Delete account
This removes all your projects for good.
Profile
Your name and photo are visible to your team.
Notifications
Email me when someone mentions me.
Delete account
This removes all your projects for good.
Installation
npx markasui@latest add separatorpnpm dlx markasui@latest add separatoryarn dlx markasui@latest add separatorbunx --bun markasui@latest add separator- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
resources/views/components/markas/separator.blade.php.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Separator.tsx.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Separator.vue.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/Separator.svelte.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Separator.astro.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/separator.component.ts.
Usage
<x-markas.separator />
<div class="flex h-5 items-center gap-3">
<span>Docs</span>
<x-markas.separator orientation="vertical" />
<span>Blog</span>
</div>
<x-markas.separator label="or" />
<x-markas.separator :decorative="false" />import { Separator } from "@/components/markas/Separator";
<Separator />
<div className="flex h-5 items-center gap-3">
<span>Docs</span>
<Separator orientation="vertical" />
<span>Blog</span>
</div>
<Separator label="or" />
<Separator decorative={false} /><template>
<Separator />
<div class="flex h-5 items-center gap-3">
<span>Docs</span>
<Separator orientation="vertical" />
<span>Blog</span>
</div>
<Separator label="or" />
<Separator :decorative="false" />
</template><script lang="ts">
import Separator from "$lib/components/markas/Separator.svelte";
</script>
<Separator class="my-4" />
<Separator orientation="vertical" />
<Separator decorative={false} label="Danger zone" />---
import Separator from "@/components/markas/Separator.astro";
---
<Separator class="my-4" />
<Separator orientation="vertical" />
<Separator decorative={false} label="Danger zone" />import { Component } from "@angular/core";
import { Separator } from "./markas/separator.component";
@Component({
selector: "app-example",
imports: [Separator],
template: `
<div markas-separator class="my-4"></div>
<div markas-separator orientation="vertical"></div>
<div markas-separator [decorative]="false" label="Danger zone"></div>
`,
})
export class Example {}Angular uses an attribute selector on a native div.
- No JavaScript needed. The Blade version does not need Alpine.js.
- A vertical separator uses
self-stretch, so place it inside a flex row with a height. - Add spacing with a class, such as
class="my-4". - The component has no built-in text. Pass
labelin the language of your site.
Props
| Name | Type | Default | Description |
|---|---|---|---|
orientation | 'horizontal' | 'vertical' | horizontal | Direction of the line. A vertical separator stretches to the height of its flex parent. |
decorative | boolean | true | Purely visual line with role=none. Set to false when the line separates meaningful sections, which adds role=separator and aria-orientation. |
label | string | - | Short text in the middle of the line, such as "or". |
Accessibility
- Decorative separators use role=none so screen readers skip them.
- With decorative=false the element gets role=separator and aria-orientation; a label also becomes its aria-label.
- The label text uses muted, which meets AA contrast in light and dark mode.
Related components
More data components with the same classes in every framework.
- AvatarRound profile photo in three sizes, with name initials as a fallback when the image is empty or fails to load.
- CardCard that groups content with an optional title, description, body, and footer.
- CarouselRow of slides built on CSS scroll snap, with previous and next buttons, optional dots, and arrow key navigation. No autoplay.
- Code BlockMonospace code block with an optional file name, line numbers, and a copy button. Plain text, no syntax highlighting.
- KbdKeycap for keyboard shortcuts using the native kbd element, in two sizes, with key combinations rendered as separate keys.
- Scroll AreaScrollable container with a thin token-styled scrollbar that keyboard users can focus and scroll. No JavaScript.