{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "list-item", "title": "List Item", "description": "Interactive list items with hover and focus effects.", "dependencies": [ "motion", "@hugeicons/core-free-icons", "@hugeicons/react", "clsx", "tailwind-merge" ], "files": [ { "path": "registry/default/example/list-item.tsx", "content": "\"use client\";\r\nimport { motion, MotionConfig } from \"motion/react\";\r\nimport { Dispatch, SetStateAction, useState } from \"react\";\r\nimport clsx from \"clsx\";\r\n\r\nimport {\r\n Appointment01Icon,\r\n BalloonsIcon,\r\n GoogleMapsIcon,\r\n ZoomIcon,\r\n ReminderIcon,\r\n TaskDaily01Icon,\r\n Tick02Icon,\r\n FilterHorizontalIcon,\r\n} from \"@hugeicons/core-free-icons\";\r\nimport { HugeiconsFreeIcons } from \"@hugeicons/core-free-icons\";\r\nimport { HugeiconsIcon } from \"@hugeicons/react\";\r\n\r\nexport type FilterKey = (typeof filterKeys)[number];\r\n\r\n// Change Here\r\nexport const filterKeys = [\r\n {\r\n name: \"tasks\",\r\n Icon: ({ size }: { size: number }) => (\r\n \r\n ),\r\n },\r\n {\r\n name: \"events\",\r\n Icon: ({ size }: { size: number }) => (\r\n \r\n ),\r\n },\r\n {\r\n name: \"reminders\",\r\n Icon: ({ size }: { size: number }) => (\r\n \r\n ),\r\n },\r\n {\r\n name: \"appointments\",\r\n Icon: ({ size }: { size: number }) => (\r\n \r\n ),\r\n },\r\n {\r\n name: \"meetings\",\r\n Icon: ({ size }: { size: number }) => (\r\n \r\n ),\r\n },\r\n {\r\n name: \"celebrations\",\r\n Icon: ({ size }: { size: number }) => (\r\n \r\n ),\r\n },\r\n];\r\n\r\nfunction ListItem(props: {\r\n index: number;\r\n filterKey: FilterKey;\r\n selectedFilterKey: FilterKey;\r\n setSelectedFilterKey: Dispatch>;\r\n setIsOpened: Dispatch>;\r\n}) {\r\n const {\r\n index,\r\n filterKey,\r\n selectedFilterKey,\r\n setSelectedFilterKey,\r\n setIsOpened,\r\n } = props;\r\n const delay = (index + 8) * 0.025;\r\n\r\n return (\r\n {\r\n setSelectedFilterKey(filterKey);\r\n\r\n setTimeout(() => {\r\n setIsOpened(false);\r\n }, 150);\r\n }}\r\n className=\"px-3 py-2 rounded-2xl flex justify-between items-center cursor-default hover:bg-accent text-foreground\"\r\n >\r\n \r\n \r\n \r\n \r\n {filterKey.name}\r\n \r\n \r\n {selectedFilterKey.name == filterKey.name && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n\r\nconst FilterInteraction = () => {\r\n const [selectedFilterKey, setSelectedFilterKey] = useState(filterKeys[0]);\r\n const [isOpened, setIsOpened] = useState(false);\r\n\r\n return (\r\n \r\n \r\n setIsOpened(true)}\r\n className=\"relative left-2.5 w-20 h-20 flex justify-center items-center\"\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n {isOpened && (\r\n \r\n \r\n {filterKeys.map((item, index) => (\r\n \r\n ))}\r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default FilterInteraction;\r\n", "type": "registry:component" } ], "type": "registry:component" }