Collapsible

An interactive component which expands/collapses a panel.

Order #4189

StatusShipped

Basic

Settings Panel

Use a trigger button to reveal additional settings.

Radius

Set the corner radius of the element.

File Tree

Use nested collapsibles to build a file tree.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::*;

#[component]
pub fn CollapsibleAnatomy() -> impl IntoView {
    view! {
        <Collapsible>
            <CollapsibleTrigger>
                <Button />
            </CollapsibleTrigger>
            <CollapsibleContent />
        </CollapsibleTrigger>
    }
}

API Reference

Collapsible

Contains the collapsible trigger and content.

Custom Attributes
NameTypeDefaultDescription
openboolfalse

A reactive signal that is directly coupled to the open state of the collapsible.

Implements global attributes.

CollapsibleContent

Contains the collapsible content.

Implements global attributes.

CollapsibleTrigger

A context provider that wraps a button that opens the collapsible menu.