Created
April 14, 2024 01:13
-
-
Save sethdavis512/2ae1c2f576a9bcef4074ec38fa19a24c to your computer and use it in GitHub Desktop.
Grid component (Tailwind)
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 ReactNode } from 'react'; | |
interface GridProps { | |
children: ReactNode; | |
as?: keyof JSX.IntrinsicElements; | |
className?: string; | |
} | |
export default function Grid({ as = 'div', children, className }: GridProps) { | |
const Component = as; | |
return ( | |
<Component className={`grid grid-cols-12 ${className}`}> | |
{children} | |
</Component> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment