Files
cosscom__coss/apps/ui/public/r/particle-bu-6.json
Volnei Munhoz d5a915e6d0 add biome
2025-11-13 19:19:31 -03:00

16 lines
1.2 KiB
JSON

{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "particle-bu-6",
"type": "registry:block",
"description": "Expandable show more/less toggle button",
"registryDependencies": ["@coss/button"],
"files": [
{
"path": "registry/default/particles/particle-bu-6.tsx",
"content": "\"use client\"\n\nimport { useState } from \"react\"\nimport { ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\n\nimport { Button } from \"@/registry/default/ui/button\"\n\nexport default function Particle() {\n const [isExpanded, setIsExpanded] = useState<boolean>(false)\n\n const toggleExpand = () => {\n setIsExpanded((prevState) => !prevState)\n }\n\n return (\n <Button\n className=\"gap-1\"\n variant=\"ghost\"\n onClick={toggleExpand}\n aria-expanded={isExpanded}\n aria-controls=\"expandable-content\" // Use this ID on the element that this button controls\n >\n {isExpanded ? \"Show less\" : \"Show more\"}\n {isExpanded ? (\n <ChevronUpIcon className=\"-me-1\" aria-hidden=\"true\" />\n ) : (\n <ChevronDownIcon className=\"-me-1\" aria-hidden=\"true\" />\n )}\n </Button>\n )\n}\n",
"type": "registry:block"
}
],
"categories": ["button"]
}