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

docs / components / feedback / sheet docs / components / feedback /

sheet

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

A panel over one side of the window.

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 sheet --to ../my-app

Files copied: src/widgets/sheet.rs, src/widgets/mod.rs, src/widgets/button.rs

Usage

rust
use amenui::widgets::{sheet};

fn view() -> El<Msg> {
    sheet("sh1", false, "筛选", 320.0, Msg::Nothing, text("条件", 13.0, Paint::TEXT))
}

API

Functionssheet
Propskey, open, title, width, close, body.
Filessrc/widgets/sheet.rs
Depends onbase, button
Response to frontsnudge (a control: pushed as one piece by fronts, held and condensing at most to Look::legible_cap)
Recompositionkeyed labels recompose when their text changes

Keyboard and accessibility

Statesclosed, open (modal: focus inside, Esc closes; the page beneath held a little loose).
Keys and messagesclose on Esc, a press on the page beside it, or its close button.

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).