Skip to content

Separator

A thin divider between groups of content. Decorative by default.

On this page
Used for
  • Menu groups
  • Toolbar dividers
  • Card sections
  • Sidebar breaks

Examples

Installation

npx knowns-ui@latest add separator
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

orientation
"horizontal" | "vertical"
Default"horizontal"
decorative
boolean
Defaulttrue
Set false for a semantic separator (role=separator).

What it handles

  1. 01Draws a 1px line in the border colour, horizontal across the full width or vertical stretching to the height of its row.
  2. 02Treats the line as decoration by default and gives it the role none, so screen readers skip it.
  3. 03Becomes a real separator with `decorative={false}`, and then exposes `aria-orientation` to match.
  4. 04Takes `orientation` as horizontal or vertical, and `className` for spacing or a different colour.
  5. 05Does not shrink inside a flex row, so a vertical rule keeps its width beside long text.
  6. 06Stays plain markup with no state, so it renders on the server.

States

Any change
It updates at once
none
Hover or focus
Nothing moves; the line is not interactive
none
Theme change
The colour follows the border token
none

Works with

When to use

When to use

  • Dividing groups in a menu, toolbar or panel.

When not to use

  • Separating page sections: spacing and headings usually do it better.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Separator to my app and wire it to my own data.
  • I need dividing groups in a menu, toolbar or panel. Set that up with the Knowns UI Separator.
  • Which Separator props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "separator" }) and search_docs({ query: "separator" }).

Need help?

Stuck on Separator, or found something off? We read every message.