limn
    ↑↓ ChooseEnter OpenEsc Close
    GitHub

    Components/System

    Separator

    A passive one-pixel rule in the palette's border color, between two regions or two groups of tools.

    Native componentGuide source

    Preview

    CodeSource
    fn view(palette: ComponentPalette) -> Element {
        Element::column(vec![
            Text::new("Above", palette).render(),
            Separator::horizontal(palette).render(),
            Text::new("Below", palette).render(),
        ])
    }

    Examples

    Each one is the library drawing it. Press, type and hover.

    Separator2 / 2
    CodeSource
    row(vec![
        tool("typography-back", Icon::ArrowLeft),
        tool("typography-forward", Icon::ArrowRight),
        Separator::vertical(palette).length(16.0).centered_in(28.0).margin(4.0).render(),
        tool("typography-refresh", Icon::Refresh),
        Separator::vertical(palette).render(),
        tool("typography-archive", Icon::Archive),
    ])

    Separator

    A passive one-pixel rule in the palette’s border color, between two regions or two groups of tools.

    Import

    use limn::{Component, Separator};

    Usage

    A horizontal rule goes between rows, a vertical one between columns or tools. Without a length it fills the axis it runs along.

    fn view(palette: ComponentPalette) -> Element {
        Element::column(vec![
            Text::new("Above", palette).render(),
            Separator::horizontal(palette).render(),
            Text::new("Below", palette).render(),
        ])
    }

    Length

    Separator::horizontal(palette).length(96.0).render()

    length fixes the rule’s length instead of filling the container.

    Margin

    Separator::horizontal(palette).margin(8.0).render()

    margin adds empty space on both sides, across the rule: above and below a horizontal one, left and right of a vertical one. The default is none.

    In a toolbar

    Separator::vertical(palette)
        .length(16.0)
        .centered_in(28.0)
        .margin(4.0)
        .render()

    centered_in(height) centers a vertical rule in a slot of that height, for a bar taller than the rule. A horizontal rule ignores it.

    Ink

    Separator::horizontal(palette).ink(palette.muted).render()

    ink paints the rule in a color the host owns, such as a tree guide, instead of the palette’s border.

    API reference

    The guide covers composition, options and actions. Generate the complete Rust type and builder reference from the checkout:

    cargo doc -p limn --open

    Component API overview · State and actions

    The example is drawn by crates/limn-gallery/src/pages/typography.rs.