Separator
Visual divider for separating content sections. Supports horizontal and vertical orientation with an optional centered label.
import { Separator } from "phoundry-ui";Basic Horizontal
Loading interactive example…
View source
<script lang="ts"> import { Separator } from "phoundry-ui";</script>
<div class="space-y-3"> <p class="text-xs text-txt-secondary">Content above</p> <Separator /> <p class="text-xs text-txt-secondary">Content below</p></div>With Label
Loading interactive example…
View source
<script lang="ts"> import { Separator } from "phoundry-ui";</script>
<div class="space-y-3"> <p class="text-xs text-txt-secondary">Content above</p> <Separator label="Or continue with" /> <p class="text-xs text-txt-secondary">Content below</p></div>Vertical
Loading interactive example…
View source
<script lang="ts"> import { Separator } from "phoundry-ui";</script>
<div class="flex h-8 items-center gap-4"> <span class="text-xs text-txt-secondary">Home</span> <Separator orientation="vertical" /> <span class="text-xs text-txt-secondary">Settings</span> <Separator orientation="vertical" /> <span class="text-xs text-txt-secondary">Profile</span></div>Center snippet (children)
Loading interactive example…
View source
<script lang="ts"> import { Separator } from "phoundry-ui"; import { Badge } from "phoundry-ui";</script>
<p class="mb-2 text-xs text-txt-secondary"> Use <code>children</code> when the center needs richer markup than a plain string <code>label</code>.</p><Separator> {#snippet children()} <Badge size="xs">Beta</Badge> {/snippet}</Separator>API
From phoundry-ui@0.4.21
| Name | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | 'horizontal' | Direction of the divider. |
label | string | — | Centered text label shown on the divider line. |
children | Snippet<[]> | — | Custom content to display in the center instead of a label. |
class | ClassValue | — | Additional CSS classes. |
style | string | — | Inline styles on the stable component root. |
Usage tips
- Use the
labelprop for “or” dividers in forms (e.g. “Or continue with”). - Vertical separators need a parent with explicit height and
display: flex. - Pass a
childrensnippet for custom center content (icons, badges, etc.).
Styling
.ph-separator is the stable root hook. Consumer class values are additive, and style applies to that root. Styling uses vanilla CSS with semantic state attributes. The root always emits data-orientation and data-has-label, and uses the matching aria-orientation for separator semantics. Its one-pixel rule, vertical stretching, centered label, and snippet precedence are unchanged. Internal part selectors and --_ph-* properties remain implementation details.