Skip to content
portalbits
Home Docs GitHub(opens in a new tab)

Guides

Get startedFoundationsMotion

Components

All components

Buttons

ButtonIconButton

Inputs

InputSelectTextareaSlider

Selection

CheckboxToggleToggleGroupSwitchRadioGroup

Identity

AvatarBadge

Overlays

DialogPopoverTooltipDropdownMenuAlertDialog

Disclosure

TabsAccordion

Cards

AppCardArticleCardFeatureCard

Content

CarouselSectionHeaderEmptyStateAlertProgressSeparatorRowListRow

Chrome

PortalShellSidebarNavMobileNavTopBarAuthFrameColorSelectorFloatingNav

Separator

A hairline between groups, decorative or announced.

Studio plan Five seats, shared drafts
Billing
Seats
History
Variations

Source

<script lang="ts">
  import 'portal-bits/styles.css';
  import 'portal-bits/tokens.css';
  import type { Snippet } from 'svelte';

  let { children }: { children: Snippet } = $props();
</script>

{@render children()}
<script lang="ts">
  import SeparatorExample from './SeparatorExample.svelte';
</script>

<SeparatorExample orientation={"horizontal"} />
<script lang="ts">
  import { Separator } from 'portal-bits';
  let { orientation = 'horizontal' }: { orientation?: 'horizontal' | 'vertical' } = $props();
</script>

<div class="card" data-orientation={orientation}>
  <div>
    <strong>Studio plan</strong>
    <span>Five seats, shared drafts</span>
  </div>
  <Separator {orientation} />
  <nav aria-label="Plan links">
    <a href="#billing">Billing</a>
    <Separator orientation="vertical" />
    <a href="#seats">Seats</a>
    <Separator orientation="vertical" />
    <a href="#history">History</a>
  </nav>
</div>

<style>
  .card {
    display: grid;
    gap: 16px;
    width: 360px;
    max-width: 100%;
    font-size: 14px;
  }
  .card[data-orientation='vertical'] {
    display: flex;
    align-items: center;
    width: auto;
  }
  div > div {
    display: grid;
    gap: 2px;
  }
  strong {
    font-weight: 500;
  }
  span {
    color: var(--portal-muted);
  }
  nav {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 20px;
  }
  a {
    color: inherit;
  }
</style>

API reference

These tables list the props and snippets that Separator declares. Attributes passed through to an element or primitive are listed under Forwarded attributes, not here.

Props

NameTypeDefaultRequiredBindingDescription
orientation'horizontal' | 'vertical'horizontalNoOne-wayDirection of the hairline.
decorativebooleantrueNoOne-wayHides the line from assistive technology. Set it to false when the line separates content.
classstring""NoOne-wayExtra classes, added after the component classes.

Forwarded attributes

None. Separator forwards no attributes.

The primitive underneath is a Bits UI peer dependency. Its own options are documented in the Bits UI Separator documentation. Only the props listed on this page are part of the Separator contract. No data attributes are documented as stable.

Limits

  • A vertical separator needs a parent with a height, such as a flex row.
  • It uses the hairline token. The 1px line is an adaptation of the measured borders.

Related

  • RowList
  • SectionHeader
Previous Progress Next RowList

On this page

  • Preview
  • Source
  • API reference
  • Props
  • Forwarded attributes
  • Limits