BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/scrollxui/collapsible

Collapsible

scrollxui/collapsible
FreeComponent

An interactive component which expands/collapses a panel with a smooth motion.

Live preview

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

Install it

npx shadcn@latest add https://scrollxui.dev/registry/collapsible.json

Source

components/ui/collapsible.tsxscrollxui.dev/registry/collapsible.json
1'use client';
2import * as React from 'react';
3import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
4import { motion } from 'motion/react';
5
6function Collapsible({
7 ...props
8}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
9 return <CollapsiblePrimitive.Root data-slot='collapsible' {...props} />;
10}
11
12function CollapsibleTrigger({
13 ...props
14}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
15 return (
16 <CollapsiblePrimitive.CollapsibleTrigger
17 data-slot='collapsible-trigger'
18 asChild
19 {...props}
20 >
21 <motion.div
22 whileHover={{ scale: 1.01 }}
23 whileTap={{ scale: 0.99 }}
24 transition={{ duration: 0.2 }}
25 >
26 {props.children}
27 </motion.div>
28 </CollapsiblePrimitive.CollapsibleTrigger>
29 );
30}
31
32function CollapsibleContent({
33 ...props
34}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
35 return (
36 <CollapsiblePrimitive.CollapsibleContent
37 data-slot='collapsible-content'
38 asChild
39 {...props}
40 >
41 <motion.div
42 initial={{ height: 0, opacity: 0 }}
43 animate={{ height: 'auto', opacity: 1 }}
44 exit={{ height: 0, opacity: 0 }}
45 transition={{
46 duration: 0.3,
47 ease: 'easeInOut',
48 }}
49 style={{ overflow: 'hidden' }}
50 >
51 {props.children}
52 </motion.div>
53 </CollapsiblePrimitive.CollapsibleContent>
54 );
55}
56
57export { Collapsible, CollapsibleTrigger, CollapsibleContent };

What it pulls in

npm packages

  • motion
  • @radix-ui/react-collapsible

Files it writes

  • src/components/ui/collapsible.tsx

Facts

Registry
scrollxui
Type
registry:ui
Access
Free
Files written
1
Licence
NOASSERTION
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

Docs on scrollxui scrollxui.dev Adityakishore0/ScrollX-UI on GitHub Raw registry item This item as JSON

More from scrollxui

All 180 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionscrollxuiComponentsFree4 deps
Alert Dialogalert-dialogscrollxuiComponentsFree7 deps
Animated Buttonanimated-buttonscrollxuiComponentsFree4 deps
Animated Tabsanimated-tabsscrollxuiComponentsFree1 dep
Animated Testimonialsanimated-testimonialsscrollxuiComponentsFree2 deps
Animated TextGenerateanimated-textgeneratescrollxuiComponentsFree3 deps
AnnouncementannouncementscrollxuiComponentsFree5 deps
Aspect Ratioaspect-ratioscrollxuiComponentsFree1 dep
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