{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "list-item", "type": "registry:ui", "title": "List Item", "description": "Row primitive: title, subtitle, leading, trailing, chevron.", "registryDependencies": [ "https://raw.githubusercontent.com/truongnat/rnui/main/registry/dist/nativewind/utils.json", "https://raw.githubusercontent.com/truongnat/rnui/main/registry/dist/nativewind/text.json", "https://raw.githubusercontent.com/truongnat/rnui/main/registry/dist/nativewind/theme.json" ], "dependencies": [ "lucide-react-native" ], "files": [ { "path": "registry/shared/ui/list-item.tsx", "type": "registry:ui", "target": "components/ui/list-item.tsx", "content": "import type { ReactNode } from 'react';\nimport { Pressable, View, type ViewProps } from 'react-native';\nimport { ChevronRight } from 'lucide-react-native';\nimport { Text } from '@/components/ui/text';\nimport { cn, useIconColor } from '@/lib/utils';\n\nexport interface ListItemProps extends ViewProps {\n title: string;\n subtitle?: string;\n /** Leading node — avatar, icon, etc. */\n leading?: ReactNode;\n /** Trailing node — overrides the default chevron when `onPress` is set. */\n trailing?: ReactNode;\n onPress?: () => void;\n /** Show the chevron affordance for pressable rows. */\n chevron?: boolean;\n className?: string;\n}\n\nexport function ListItem({\n title,\n subtitle,\n leading,\n trailing,\n onPress,\n chevron = true,\n className,\n ...props\n}: ListItemProps) {\n const iconColor = useIconColor();\n const content = (\n \n {leading}\n \n \n {title}\n \n {subtitle && (\n \n {subtitle}\n \n )}\n \n {trailing ??\n (onPress && chevron && )}\n \n );\n\n if (!onPress) return content;\n return (\n \n {content}\n \n );\n}\n\nexport function ListSeparator({\n className,\n ...props\n}: ViewProps & { className?: string }) {\n return ;\n}\n\nexport function ListSectionTitle({\n className,\n children,\n ...props\n}: ViewProps & { className?: string; children?: ReactNode }) {\n return (\n \n {typeof children === 'string' ? (\n \n {children}\n \n ) : (\n children\n )}\n \n );\n}\n" } ] }