Download chakra-ui/packages/react/src/components/input-addon/input-addon.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 741 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/components/input-addon/input-addon.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/components/input-addon/input-addon.tsx
-
curl -L -o input-addon.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/packages/react/src/components/input-addon/input-addon.tsx
741 Bytes
| "use client" | |
| import { forwardRef } from "react" | |
| import { | |
| EMPTY_SLOT_STYLES, | |
| type HTMLChakraProps, | |
| type RecipeProps, | |
| type UnstyledProp, | |
| chakra, | |
| useRecipe, | |
| } from "../../styled-system" | |
| export interface InputAddonProps | |
| extends HTMLChakraProps<"div">, | |
| RecipeProps<"inputAddon">, | |
| UnstyledProp {} | |
| export const InputAddon = forwardRef<HTMLDivElement, InputAddonProps>( | |
| function InputAddon({ unstyled, ...props }, ref) { | |
| const recipe = useRecipe({ key: "inputAddon", recipe: props.recipe }) | |
| const [variantProps, localProps] = recipe.splitVariantProps(props) | |
| const styles = unstyled ? EMPTY_SLOT_STYLES : recipe(variantProps) | |
| return <chakra.div ref={ref} {...localProps} css={[styles, props.css]} /> | |
| }, | |
| ) | |