Collapsible
A section that can be collapsed and expanded.
Anatomy
Section titled “Anatomy”<Collapsible> <CollapsibleTrigger /> <CollapsibleContent /></Collapsible>Import <Collapsible>, <CollapsibleTrigger>, and <CollapsibleContent> and compose them together.
import { Button } from "stylus-ui/Button";import { Card } from "stylus-ui/Card";import { Collapsible, CollapsibleTrigger, CollapsibleContent,} from "stylus-ui/Collapsible";import { faAnglesUpDown } from "@fortawesome/pro-regular-svg-icons";
export default () => ( <Collapsible className="flex flex-col items-center gap-2"> <CollapsibleTrigger asChild> <Button variant="secondary" icon={faAnglesUpDown} aria-label="Toggle" /> </CollapsibleTrigger> <CollapsibleContent> <Card>Peekaboo</Card> </CollapsibleContent> </Collapsible>);API Reference
Section titled “API Reference”Collapsible
Section titled “Collapsible”Inherits properties from HTMLElement.
CollapsibleTrigger
Section titled “CollapsibleTrigger”Inherits properties from HTMLButtonElement.
CollapsibleContent
Section titled “CollapsibleContent”Inherits properties from HTMLElement.