| { | |
| "type": "composition", | |
| "npmDependencies": [], | |
| "fileDependencies": [], | |
| "id": "radio", | |
| "file": { | |
| "name": "radio.tsx", | |
| "content": "import { RadioGroup as ChakraRadioGroup } from \"@chakra-ui/react\"\nimport * as React from \"react\"\n\nexport interface RadioProps extends ChakraRadioGroup.ItemProps {\n rootRef?: React.RefObject<HTMLDivElement | null>\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>\n}\n\nexport const Radio = React.forwardRef<HTMLInputElement, RadioProps>(\n function Radio(props, ref) {\n const { children, inputProps, rootRef, ...rest } = props\n return (\n <ChakraRadioGroup.Item ref={rootRef} {...rest}>\n <ChakraRadioGroup.ItemHiddenInput ref={ref} {...inputProps} />\n <ChakraRadioGroup.ItemIndicator />\n {children && (\n <ChakraRadioGroup.ItemText>{children}</ChakraRadioGroup.ItemText>\n )}\n </ChakraRadioGroup.Item>\n )\n },\n)\n\nexport const RadioGroup = ChakraRadioGroup.Root\n" | |
| }, | |
| "component": "Radio" | |
| } |