Collapsible: Show more
The panel sits above its trigger. When it closes, the gap in the parent’s flex layout collapses in the same animation, so the button below never jumps.
HextaUI components are built on Base UI primitives and styled with Tailwind. You own the source, so every class can be changed.
Motion is interruptible: clicking again mid-animation reverses from where the panel is instead of snapping. The gap between this paragraph and its neighbours collapses in the same animation, so nothing below jumps when it finishes.
This adds the example as components/examples/collapsible/show-more.tsx, together with the Collapsible component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/collapsible-show-more.jsonTo add only the component, follow the Collapsible installation.
Props in this example
The Collapsible props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
open | boolean | – |
onOpenChange | (open: boolean, details) => void | – |
| Prop | Type | Default |
|---|---|---|
renderUsually a Button. | ReactElement | (props, state) => ReactElement | <button> |
Every prop is in the Collapsible API reference.
- Open by default
- Controlled
- Disabled
- Custom icon
- File tree
- Inside a card
- Unmounted when closed
- Long content
- Right to left
See them all, with keyboard support and accessibility notes, on the Collapsible page.
- AccordionStacked headings that each reveal a panel, with height motion you can reverse mid-way and panels that stay searchable while closed.
- Aspect ratioA box that holds its shape before media loads, shimmers while loading, fades the media in and falls back when it fails.
- CarouselNative scroll-snap slides with momentum on touch, mouse dragging, arrow keys, dots, thumbnails and an autoplay that pauses when it should.
- ResizablePanels you can drag apart, with a quiet divider that wakes up on hover, sizes that glide on reset or collapse, and layouts that persist.
- Scroll areaNative scrolling with a minimal scrollbar, edges that fade only where there’s more to see, and an optional peek that cuts the last item in half.
- SeparatorA hairline that divides content horizontally or vertically, with an optional label and a decorative mode for purely visual lines.