Navigation & disclosure@neumorphism-ui/collapsible

Collapsible

Reveal or hide one group of optional settings. Name the trigger for its content. Check expansion with Enter and Space.

@neumorphism-ui/collapsible
Registry JSON

Preview

Installation

Installation: collapsiblenpx shadcn@latest add @neumorphism-ui/collapsible

The CLI resolves npm dependencies, base tokens, utilities, and component source in order.

New to this Registry? Set up the namespace before continuing.

Usage

Import

Collapsible import code
"use client";

import * as React from "react";
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@/components/ui/collapsible";

Example

Collapsible usage code
export default function Example() {
  const [expanded, setExpanded] = React.useState(false);
  return (<Collapsible open={expanded} onOpenChange={setExpanded}><CollapsibleTrigger>{"Advanced settings"}<span aria-hidden="true">{expanded ? "−" : "+"}</span></CollapsibleTrigger><CollapsibleContent><div>{"Reveal optional settings without changing the defaults."}</div></CollapsibleContent></Collapsible>);
}

API Reference

ComponentPropTypeDefaultDescription
Collapsibleopen / defaultOpenboolean—Set controlled or initial state.
CollapsibleTriggerdisabledboolean—Disable user interaction.
CollapsibleContentkeepMountedboolean—Keep the panel mounted while closed.

Accessibility

  • 01

    Name the trigger for its content. Check expansion with Enter and Space.

  • 02

    Preserve labels and visible focus when customizing render or className.