Michael starred 4 repositories
synccn/ui
- synccn/cli
- synccn/themes
- synccn/blocks
Installation
$ pnpm dlx shadcn@latest add @synccn/collapsibleFirst time in this project? Connect synccn with one command.
Usage
import { Collapsible } from "@/components/ui/collapsible";<Collapsible trigger="Show more">…</Collapsible>API reference
Generated from the component's TypeScript types, so it always matches the code.
Collapsible
One section that expands and collapses with a height animation.
PropTypeDescription
- open
booleanControlled open state.
- defaultOpen
booleanDefault
falseInitial state when uncontrolled.
- onOpenChange
(open: boolean) => voidCalled when it opens or closes.
- triggerrequired
| React.ReactNode | ((state: { open: boolean; toggle: () => void; "aria-expanded": boolean; "aria-controls": string }) => React.ReactNode)Trigger content, or a render function for a custom trigger.
- children
React.ReactNodeContent to render.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for ChevronsUpDown
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-controls, aria-expanded
More display
CardSurface with header, content and footer slots.BadgeSmall status label with an optional dot.AvatarImage with initials fallback, presence dot and stacked groups.KbdKeyboard key for shortcuts and hints.SeparatorHorizontal, vertical or labelled divider.AccordionExpanding sections with smooth height animation.