Skip to content

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.

MethodTypeDefaultDescription
.horizontal()defaultSet orientation to horizontal
.vertical()Set orientation to vertical
.length(length)impl Into<DefiniteLength>fullCustom 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.

Released under the MIT License.