Select base theme

Select color scheme

Toggle dark mode

GitHub repository

Collapsible

An interactive component which expands/collapses a panel.

Order #4189

Status

Shipped

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 content of a collapsible menu.

Implements global attributes.

CollapsibleTrigger

A context provider that wraps a Button component that triggers the collapsible menu.