-
-
Save crashmax-dev/8e427473a38b784b7658f0c569c8eb0c to your computer and use it in GitHub Desktop.
React TailwindCSS component example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { FC, HTMLAttributes } from "react"; | |
type BoxProps = { | |
as?: keyof JSX.IntrinsicElements; | |
} & HTMLAttributes<HTMLOrSVGElement>; | |
export const Box: FC<BoxProps> = ({ as: Component = "div", ...props }) => { | |
return <Component {...props} />; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment