amenui
en·中 github ↗ v0.0.1
01docs 02components 03lab 04works
en·中github ↗
×

docs / components / layout / divider docs / components / layout /

divider

04.34
On this page ▾
  1. Installation
  2. Usage
  3. API
  4. Keyboard and accessibility

Separate two groups of content.

drawn by amenuiopen ↗

Installation

Components are distributed as source. Copy it and what it depends on into your project, then change it as you need:

sh
cargo run --release --bin amenui -- add divider --to ../my-app

Files copied: src/widgets/divider.rs, src/widgets/mod.rs

Usage

rust
use amenui::widgets::{divider, vdivider};

fn view() -> El<Msg> {
    col().width(240.0).gap(8.0).child(text("上", 13.0, Paint::TEXT)).child(divider(1.0)).child(text("下", 13.0, Paint::TEXT))
}

API

Functionsdivider, vdivider
Propsthickness (logical px).
Filessrc/widgets/divider.rs
Depends onbase
Response to frontsloosen (decoration)
Recompositionkeyed labels recompose when their text changes

Keyboard and accessibility

Statesnone.
Keys and messagesnone.

On the web every control is mirrored into the page as an element with its role and name, so screen readers and the browser's own focus see it (DESIGN.md §1.14).