Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Collapsible

An interactive component which expands/collapses a panel.

@huntabyte starred 3 repositories

@huntabyte/bits-ui

Installation

pnpm add @heyramzi/ui bits-ui

Usage

import * as Collapsible from "@heyramzi/ui/shadcn/collapsible";
<Collapsible.Root>
  <Collapsible.Trigger>Show all repositories</Collapsible.Trigger>
  <Collapsible.Content>
    <p>@melt-ui/melt-ui</p>
    <p>@sveltejs/svelte</p>
  </Collapsible.Content>
</Collapsible.Root>

Keyboard and accessibility

Key Does
Space Enter Opens or closes the content.
  • The trigger is a button that reports open or closed and points at the content.

API reference

Collapsible.Root

ref bindable HTMLElement | null
Default null
open bindable boolean
Default false
...rest
Every prop of Collapsible.Root from bits-ui
Prop Type Default
ref bindable HTMLElement | null null
open bindable boolean false
...rest Every prop of Collapsible.Root from bits-ui

Collapsible.Trigger

ref bindable HTMLElement | null
Default null
...rest
Every prop of Collapsible.Trigger from bits-ui
Prop Type Default
ref bindable HTMLElement | null null
...rest Every prop of Collapsible.Trigger from bits-ui

Collapsible.Content

ref bindable HTMLElement | null
Default null
...rest
Every prop of Collapsible.Content from bits-ui
Prop Type Default
ref bindable HTMLElement | null null
...rest Every prop of Collapsible.Content from bits-ui