Skip to content
Brok UI

Loading…

No results

Separator

Open source Core

Horizontal or vertical separator for grouping content.

Version
v1.0.3
Stability
stable
License
MIT
Related
Stack
Cluster
Item

Preview

Profile

Docs
Source
Orientation
previews.components.separator.default.blade.php Blade
<div class="w-full max-w-sm text-start text-sm text-foreground">
    <p>{{ __('Profile') }}</p>
    <x-ui.separator class="my-3" />
    <div class="flex h-5 items-center gap-3">
        <span>{{ __('Docs') }}</span>
        <x-ui.separator orientation="vertical" />
        <span>{{ __('Source') }}</span>
    </div>
</div>
Horizontal Current
Vertical Current

Installation

terminal
php artisan ui:add separator

Registry contract

php artisan ui:add separator writes only the files below. The CLI validates each file hash before writing and asks before it replaces a local change, unless you pass --force.

  • blade resources/views/components/ui/separator.blade.php
Registry dependencies
None — installs on its own.
Packages
composer: jml/brok:^0.2

Use with AI

A brief for your coding agent: install command, usage, props, guidance and the rules. Copy it, or open a prompt about this component in an assistant.

separator.md
# Brok UI: Separator (`separator`)

Horizontal or vertical separator for grouping content.

Brok UI is a Laravel Blade component registry. Installed components are plain Blade files the app owns.

## Install

```bash
php artisan ui:add separator
```

## Usage

```blade
<div class="w-full max-w-sm text-start text-sm text-foreground">
    <p>{{ __('Profile') }}</p>
    <x-ui.separator class="my-3" />
    <div class="flex h-5 items-center gap-3">
        <span>{{ __('Docs') }}</span>
        <x-ui.separator orientation="vertical" />
        <span>{{ __('Source') }}</span>
    </div>
</div>
```

## Props

- `orientation` (string, default `horizontal`) — Direction of the rule: horizontal (full width, 1px tall) or vertical (full height, 1px wide).
- `decorative` (bool, default `true`) — When true, hides the separator from assistive tech (role="none"); when false, exposes role="separator" with aria-orientation for a structurally meaningful divider.

## Use when

- Use to structure hierarchy, spacing, and responsiveness so content is easier to scan and navigate.
- Drawing a thin visual rule between groups of content, such as menu sections or toolbar clusters.
- Needing a semantic role="separator" for a divider that carries real structural meaning, not just decoration.

## Avoid when

- Do not let layout primitives substitute for semantics, headings, or interaction rules users still need.
- The divide is purely a spacing choice; use margin or gap instead of an extra element.
- The boundary needs to carry a visible label, such as "OR"; compose a custom row instead of the bare separator.

## Anti-patterns

- Using visual layout as a substitute for semantic structure

## Rules

- Use the `<brok:separator>` tag (or `<x-ui.separator>`) in Blade; do not rewrite the component.
- Prefer the documented props and variants over utility-class overrides; when a utility must win, use the `!` important modifier.
- Use semantic design tokens (`bg-primary`, `text-muted-foreground`), never raw colour utilities.
- Keep the `data-slot` attributes; they are the styling and test hooks.

## Links

- Docs: https://brokui.dev/docs/components/separator
- Registry JSON (files, props, contract): https://brokui.dev/r/open/separator.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

API

manifest knowledge + registry-derived coverage

Props

Props accepted by this component: name, type, default value and description.
Prop Type Default Description
orientation string horizontal Direction of the rule: horizontal (full width, 1px tall) or vertical (full height, 1px wide).
decorative bool true When true, hides the separator from assistive tech (role="none"); when false, exposes role="separator" with aria-orientation for a structurally meaningful divider.

Slots

  • default —

Data slots

Stable hooks for CSS overrides and browser tests.

separator

Behavior

  • Renders a single non-interactive line whose thickness and axis follow the orientation prop.
  • Declares registry capability flags: a11y, responsive, rtl, darkMode, localized.

Guidance

Layout and content structure

Structure content hierarchy and responsive relationships.

Use when

  • Use to structure hierarchy, spacing, and responsiveness so content is easier to scan and navigate.
  • Drawing a thin visual rule between groups of content, such as menu sections or toolbar clusters.
  • Needing a semantic role="separator" for a divider that carries real structural meaning, not just decoration.

Avoid when

  • Do not let layout primitives substitute for semantics, headings, or interaction rules users still need.
  • The divide is purely a spacing choice; use margin or gap instead of an extra element.
  • The boundary needs to carry a visible label, such as "OR"; compose a custom row instead of the bare separator.

Use instead

  • Semantic HTML with standard flow

Anti-patterns

  • Using visual layout as a substitute for semantic structure
Anatomy
root
Theming hooks
separator

Accessibility

WCAG 2.2 AA Keyboard focus-visible RTL-ready Localized labels Dark mode
Keyboard
No component-owned keyboard interaction; native element behavior applies.
Focus
none
  • Defaults to decorative (role="none") since most separators are purely visual; set decorative to false only when the divider marks a real structural boundary assistive tech should announce.
  • Semantic HTML and a stable data-slot attribute for styling and scripting hooks.
  • Focus-visible rings use the ring token, so keyboard focus is always visible.
  • Disabled and invalid states are conveyed to assistive tech, not by color alone.
  • Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces in the preview.
  • Labels go through __() and layout uses logical properties (ms-*, text-start), so it mirrors under dir="rtl" — flip the preview to RTL to confirm.
  • Dark mode uses the same semantic tokens under the dark class; high contrast follows forced-color system tokens.

Livewire

Safe

Livewire can update this component through forwarded wire:* attributes.

Source

The exact, editable file ui:add writes into your app. Previews render this same code; there are no preview-only components.

resources/views/components/ui/separator.blade.php Blade
@props([
    'orientation' => 'horizontal',
    'decorative' => true,
])

@php
    $orientations = [
        'horizontal' => 'h-px w-full',
        'vertical' => 'h-full w-px',
    ];

    $classes = trim('shrink-0 bg-border '.($orientations[$orientation] ?? $orientations['horizontal']));
@endphp

<div
    data-slot="separator"
    data-orientation="{{ $orientation }}"
    @if ($decorative)
        role="none"
    @else
        role="separator"
        aria-orientation="{{ $orientation }}"
    @endif
    {{ $attributes->merge(['class' => $classes]) }}
></div>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.0.3
Status
Stable
License
open
Accessibility reviewed
No review date recorded
Last breaking change
No date recorded
Deprecation
Not deprecated
Contract
v6
Foundation
≥ 1.0.0