Separator
View as MarkdownA separator element between groups of content, read by screen readers.
Features
Permalink to heading "Features"role="separator"witharia-orientation- Horizontal or vertical
- Server-rendered only, it needs no client script
- Works with
asChild, e.g. on an<li>in a list
The separator is a single element, so the file named after its folder is the root (<ui:separator>). See Root or the Folder Name.
<primitives:separator />
Installation
Permalink to heading "Installation"typo3 ui:add separator
Please copy the files manually from GitHub into your project: Separator
Read more about installing Components and Primitives.
Examples
Permalink to heading "Examples"Separate stacked content
Permalink to heading "Separate stacked content"A separator is horizontal by default. Style it through data-orientation="horizontal".
Order summary
3 items, shipped in 2 days
Separate items in a row
Permalink to heading "Separate items in a row"Set orientation to vertical for a separator between items side by side, as in the links at the top of this page. It renders aria-orientation="vertical" and data-orientation="vertical".
<ui:separator
orientation="{f:constant(name: 'Jramke\FluidPrimitives\Enum\Orientation::Vertical')}"
/>
API Reference
Permalink to heading "API Reference"The following tables cover the available props of the Fluid Primitives. For a full list of available client side props and methods, see the Zag.js Machine API.
separator
Permalink to heading "separator"The separator. Renders a <div> element with data-orientation set to horizontal or vertical.
| Name | Description | Required | Default |
|---|---|---|---|
orientation | Enum\OrientationThe orientation of the separator. | No | Horizontal |
attributes | arrayAdditional attributes that should be rendered on the component where ui:attributes is used. | No | [] |
asChild | booleanIf true the component uses its child only without the component template. Like Radix UI asChild or Base UI render props. | No | - |
rootId | stringThe root ID of the component, used for hydration and identification. | No | - |
ids | arrayThe IDs of of the component parts for composition. | No | [] |
autoMount | booleanWhether the client initializes the component on its own. Set it to false to mount it yourself with `mount()` | No | true |
class | stringThe CSS class(es) to be applied to the component. | No | - |