{ "name": "checkbox-card", "file": "compositions/ui/checkbox-card", "snippet": "import { CheckboxCard as ChakraCheckboxCard } from \"@chakra-ui/react\"\nimport * as React from \"react\"\n\nexport interface CheckboxCardProps extends ChakraCheckboxCard.RootProps {\n icon?: React.ReactElement\n label?: React.ReactNode\n description?: React.ReactNode\n addon?: React.ReactNode\n indicator?: React.ReactNode | null\n indicatorPlacement?: \"start\" | \"end\" | \"inside\"\n inputProps?: React.InputHTMLAttributes\n}\n\nexport const CheckboxCard = React.forwardRef<\n HTMLInputElement,\n CheckboxCardProps\n>(function CheckboxCard(props, ref) {\n const {\n inputProps,\n label,\n description,\n icon,\n addon,\n indicator = ,\n indicatorPlacement = \"end\",\n ...rest\n } = props\n\n const hasContent = label || description || icon\n const ContentWrapper = indicator ? ChakraCheckboxCard.Content : React.Fragment\n\n return (\n \n \n \n {indicatorPlacement === \"start\" && indicator}\n {hasContent && (\n \n {icon}\n {label && (\n {label}\n )}\n {description && (\n \n {description}\n \n )}\n {indicatorPlacement === \"inside\" && indicator}\n \n )}\n {indicatorPlacement === \"end\" && indicator}\n \n {addon && {addon}}\n \n )\n})\n\nexport const CheckboxCardIndicator = ChakraCheckboxCard.Indicator\n", "examples": [ { "name": "checkbox-card-basic", "content": "export const CheckboxCardBasic = () => {\n return (\n \n \n \n Next.js\n \n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import { CheckboxCard } from \"@chakra-ui/react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" }, { "name": "checkbox-card-closed-component", "content": "export interface CheckboxCardProps extends ChakraCheckboxCard.RootProps {\n icon?: React.ReactElement\n label?: React.ReactNode\n description?: React.ReactNode\n addon?: React.ReactNode\n indicator?: React.ReactNode | null\n indicatorPlacement?: \"start\" | \"end\" | \"inside\"\n inputProps?: React.InputHTMLAttributes\n}\n\nexport const CheckboxCard = React.forwardRef<\n HTMLInputElement,\n CheckboxCardProps\n>(function CheckboxCard(props, ref) {\n const {\n inputProps,\n label,\n description,\n icon,\n addon,\n indicator = ,\n indicatorPlacement = \"end\",\n ...rest\n } = props\n\n const hasContent = label || description || icon\n const ContentWrapper = indicator ? ChakraCheckboxCard.Content : React.Fragment\n\n return (\n \n \n \n {indicatorPlacement === \"start\" && indicator}\n {hasContent && (\n \n {icon}\n {label && (\n {label}\n )}\n {description && (\n \n {description}\n \n )}\n {indicatorPlacement === \"inside\" && indicator}\n \n )}\n {indicatorPlacement === \"end\" && indicator}\n \n {addon && {addon}}\n \n )\n})\n\nexport const CheckboxCardIndicator = ChakraCheckboxCard.Indicator\n", "hasSnippet": false, "importPaths": [ "import { CheckboxCard as ChakraCheckboxCard } from \"@chakra-ui/react\"", "import * as React from \"react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" }, { "name": "checkbox-card-disabled", "content": "export const CheckboxCardDisabled = () => {\n return (\n \n \n \n \n Disabled\n \n This is a disabled checkbox\n \n \n \n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import { CheckboxCard } from \"@chakra-ui/react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" }, { "name": "checkbox-card-no-indicator", "content": "export const CheckboxCardNoIndicator = () => {\n return (\n \n \n \n \n Chakra UI\n \n \n\n \n \n \n Next.js\n \n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import { CheckboxCard, HStack } from \"@chakra-ui/react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" }, { "name": "checkbox-card-with-addon", "content": "export const CheckboxCardWithAddon = () => {\n return (\n \n \n \n \n With Addon\n Some description\n \n \n \n \n \n Some supporting text\n New\n \n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import { Badge, CheckboxCard, HStack } from \"@chakra-ui/react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" }, { "name": "checkbox-card-with-description", "content": "export const CheckboxCardWithDescription = () => {\n return (\n \n \n \n \n Next.js\n Best for apps\n \n \n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import { CheckboxCard } from \"@chakra-ui/react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" }, { "name": "checkbox-card-with-group", "content": "export const CheckboxCardWithGroup = () => {\n return (\n \n \n Select framework(s)\n \n \n {items.map((item) => (\n \n \n \n \n {item.title}\n \n {item.description}\n \n \n \n \n \n ))}\n \n \n )\n}\n\nconst items = [\n { value: \"next\", title: \"Next.js\", description: \"Best for apps\" },\n { value: \"vite\", title: \"Vite\", description: \"Best for SPAs\" },\n { value: \"astro\", title: \"Astro\", description: \"Best for static sites\" },\n]\n", "hasSnippet": false, "importPaths": [ "import { CheckboxCard, CheckboxGroup, Flex, Text } from \"@chakra-ui/react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" }, { "name": "checkbox-card-with-icon", "content": "export const CheckboxCardWithIcon = () => {\n return (\n \n \n {items.map((item) => (\n \n \n \n \n \n {item.icon}\n \n {item.label}\n \n {item.description}\n \n \n \n \n \n \n \n ))}\n \n \n )\n}\n\nconst items = [\n { icon: , label: \"Admin\", description: \"Give full access\" },\n { icon: , label: \"User\", description: \"Give limited access\" },\n {\n icon: ,\n label: \"Guest\",\n description: \"Give read-only access\",\n },\n { icon: , label: \"Blocked\", description: \"No access\" },\n]\n", "hasSnippet": false, "importPaths": [ "import {\n CheckboxCard,\n CheckboxGroup,\n Float,\n Icon,\n SimpleGrid,\n} from \"@chakra-ui/react\"", "import { HiGlobeAlt, HiLockClosed, HiShieldCheck, HiUser } from \"react-icons/hi\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"", "npmDependencies": [ "react-icons" ] }, { "name": "checkbox-card-with-sizes", "content": "export const CheckboxCardWithSizes = () => {\n return (\n \n \n {(size) => (\n \n \n \n \n Checkbox {size}\n \n \n \n \n )}\n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import { CheckboxCard, For, Stack } from \"@chakra-ui/react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" }, { "name": "checkbox-card-with-states", "content": "export const CheckboxCardWithStates = () => {\n return (\n \n \n \n \n \n \n \n )\n}\n\nconst DemoCheckboxCard = (props: CheckboxCard.RootProps) => {\n return (\n \n \n \n \n Next.js\n Best for apps\n \n \n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import { CheckboxCard, Stack } from \"@chakra-ui/react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" }, { "name": "checkbox-card-with-variants", "content": "export const CheckboxCardWithVariants = () => {\n return (\n \n \n {(variant) => (\n \n \n \n Checkbox {variant}\n \n \n \n )}\n \n \n )\n}\n", "hasSnippet": false, "importPaths": [ "import { CheckboxCard, For, Stack } from \"@chakra-ui/react\"" ], "importPath": "import { CheckboxCard } from \"@chakra-ui/react\"" } ] }