Skip to content
GitHub11 stars

An interactive component which expands/collapses a panel.

Order #4189

Status Shipped
<Collapsible @bind-Open="_isOpen" Class="flex w-[350px] flex-col gap-2">
    <div class="flex items-center justify-between gap-4 px-4">
        <h4 class="text-sm font-semibold">Order #4189</h4>

Installation

dnx Blazix.Cli add collapsible

Usage

<Collapsible>
    <CollapsibleTrigger>Can I use this in my project?</CollapsibleTrigger>
    <CollapsibleContent>Yes. Free to use for personal and commercial projects. No attribution required.</CollapsibleContent>
</Collapsible>

Composition

Use the following composition to build a Collapsible:

Collapsible
├── CollapsibleTrigger
└── CollapsibleContent

Controlled State

Use the Open and OpenChanged parameters to control the state.

<Collapsible @bind-Open="_open">
    <CollapsibleTrigger>Toggle</CollapsibleTrigger>
    <CollapsibleContent>Content</CollapsibleContent>
</Collapsible>

@code {
    private bool _open;
}

Basic

<Card Class="mx-auto w-full max-w-sm">
    <CardContent>
        <Collapsible Class="rounded-md data-open:bg-muted">

Settings Panel

Use a trigger button to reveal additional settings.

Radius
Set the corner radius of the element.
<Card Class="mx-auto w-full max-w-xs" Size="CardSize.Sm">
    <CardHeader>
        <CardTitle>Radius</CardTitle>

File Tree

Use nested collapsibles to build a file tree. In a conversation, this is the File Tree pattern.

<Card Class="mx-auto w-full max-w-[16rem] gap-2" Size="CardSize.Sm">
    <CardHeader>
        <Tabs Value="explorer">

RTL

To enable RTL support in Blazix, see the RTL configuration guide.

Translated with AI for the demo, so it may have mistakes.

الطلب #4189

الحالة تم الشحن
<Collapsible @bind-Open="_isOpen" Class="flex w-[350px] max-w-full flex-col gap-2">
    <div class="flex items-center justify-between gap-4 px-4">
        <h4 class="text-sm font-semibold">@T.OrderNumber</h4>

API Reference

Collapsible

ParameterTypeDefault
Render RenderFragment<CollapsibleRenderProps>? -
Open bool false
OpenChanged EventCallback<bool> -
OnOpenChange EventCallback<OpenChangeEventArgs> -
Disabled bool false
Class string? -
ChildContent RenderFragment? -

Other attributes are passed to the element it renders.

CollapsibleContent

ParameterTypeDefault
Render RenderFragment<CollapsiblePanelRenderProps>? -
KeepMounted bool false
HiddenUntilFound bool? -
Class string? -
ChildContent RenderFragment? -

Other attributes are passed to the element it renders.

CollapsibleTrigger

ParameterTypeDefault
Render RenderFragment<CollapsibleRenderProps>? -
NativeButton bool? -
Class string? -
ChildContent RenderFragment? -

Other attributes are passed to the element it renders.