Separator
A thin line that visually divides content. Horizontal or vertical.
When to use
- Dividing sections of a page or panel.
- Separating items in a toolbar or menu.
API
Separator::new()
Creates a separator, horizontal by default.
| Method | Type | Default | Description |
|---|---|---|---|
.horizontal() | — | default | Set orientation to horizontal |
.vertical() | — | — | Set orientation to vertical |
.length(length) | impl Into<DefiniteLength> | full | Custom length (width for horizontal, height for vertical) |
Usage
rust
use gpui::{Component, div, prelude::*};
use components::Separator;
div()
.child(Component::new(Separator::new().horizontal()))
.child(Component::new(Separator::new().vertical()))Copy the source
crates/components/src/separator.rs — self-contained, stateless, and free to modify.