Components / Disclosure

Disclosure

Header that shows or hides its content.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn disclosure() -> impl View {
    Disclosure::new("Advanced options", Text::new("Shown when open.").foreground(Semantic::InkMuted))
        // Tells what is inside while it is closed. `.switch` and `.expanded` take bindings.
        .mark(Dot::new().tone(Tone::Warning).label("Changed"))
}

Open in the playground, with every example →

Full API of Disclosure →