BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/adn-ui/collapsible

Collapsible

adn-ui/collapsible
FreeComponent

A collapsible panel controlled by a trigger button.

Live preview

live · rendered by the registry
Rendered by adn-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://ui.awaiden.com/r/collapsible.json

Source

src/components/ui/collapsible/collapsible.tsxui.awaiden.com/r/collapsible.json
1"use client";
2
3import "./collapsible.css";
4import { Collapsible as BaseCollapsible } from "@base-ui/react/collapsible";
5import type React from "react";
6import { cn } from "tailwind-variants";
7
8import { CollapsibleContext, useCollapsibleContext } from "./collapsible.context";
9import { collapsibleVariants, type CollapsibleVariants } from "./collapsible.variants";
10
11export type CollapsibleProps = CollapsibleVariants &
12 React.ComponentProps<typeof BaseCollapsible.Root>;
13
14export const CollapsibleRoot = ({ children, className, variant, ...props }: CollapsibleProps) => {
15 const slots = collapsibleVariants({ variant });
16
17 return (
18 <CollapsibleContext.Provider value={{ slots }}>
19 <BaseCollapsible.Root className={cn(slots.root(), className)} {...props}>
20 {children}
21 </BaseCollapsible.Root>
22 </CollapsibleContext.Provider>
23 );
24};
25
26export type CollapsibleTriggerProps = React.ComponentProps<typeof BaseCollapsible.Trigger> & {
27 hideChevron?: boolean;
28};
29
30export const CollapsibleTrigger = ({
31 children,
32 className,
33 hideChevron = false,
34 ...props
35}: CollapsibleTriggerProps) => {
36 const { slots } = useCollapsibleContext();
37 return (
38 <BaseCollapsible.Trigger className={cn(slots.trigger(), className)} {...props}>
39 {children}
40 {!hideChevron && (
41 <svg
42 className="text-muted-foreground h-4 w-4 shrink-0 transition-transform duration-150 group-data-panel-open:rotate-90"
43 fill="none"
44 stroke="currentColor"
45 strokeLinecap="round"
46 strokeLinejoin="round"
47 strokeWidth="2"
48 viewBox="0 0 24 24"
49 >
50 <path d="m9 18 6-6-6-6" />
51 </svg>
52 )}
53 </BaseCollapsible.Trigger>
54 );
55};
56
57export type CollapsiblePanelProps = React.ComponentProps<typeof BaseCollapsible.Panel>;
58
59export const CollapsiblePanel = ({ children, className, ...props }: CollapsiblePanelProps) => {
60 const { slots } = useCollapsibleContext();
61 return (
62 <BaseCollapsible.Panel className={cn(slots.panel(), className)} {...props}>
63 <div className="text-muted-foreground px-1 py-2">{children}</div>
64 </BaseCollapsible.Panel>
65 );
66};

What it pulls in

npm packages

  • @base-ui/react
  • tailwind-variants

Files it writes

  • src/components/ui/collapsible/collapsible.tsx
  • src/components/ui/collapsible/collapsible.variants.ts
  • src/components/ui/collapsible/collapsible.context.ts
  • src/components/ui/collapsible/collapsible.css
  • src/components/ui/collapsible/index.ts

Facts

Registry
adn-ui
Type
registry:ui
Access
Free
Files written
5
Licence
MIT
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on adn-ui ui.awaiden.com awaiden/adn-ui on GitHub Raw registry item This item as JSON

More from adn-ui

All 46 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionadn-uiComponentsFree2 deps · 5 files
Alert Dialogalert-dialogadn-uiComponentsFree2 deps · 5 files
Aspect Ratioaspect-ratioadn-uiComponentsFree1 dep · 5 files
Autocompleteautocompleteadn-uiComponentsFree2 deps · 5 files
Avataravataradn-uiComponentsFree2 deps · 5 files
Badgebadgeadn-uiComponentsFree1 dep · 5 files
Breadcrumbbreadcrumbadn-uiComponentsFree1 dep · 5 files
Buttonbuttonadn-uiComponentsFree1 dep · 4 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex