Created
October 17, 2023 04:09
-
-
Save WasathTheekshana/c79eb741f20c7a5c5dd5f92434e9e0e3 to your computer and use it in GitHub Desktop.
A container to wrap all the children elements according to the break points | NEXTJS COMPONENT | TAILWIND CSS
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
// Use this component to wrap all the content of the page | |
'use client'; | |
interface ContainerProps { | |
children: React.ReactNode; | |
} | |
const Container: React.FC<ContainerProps> = ({ | |
children | |
}) => { | |
return ( | |
<div | |
className=" | |
relative | |
max-w-[1400px] | |
mx-auto | |
xl:px-20 | |
md:px-10 | |
sm:px-2 | |
px-6 | |
"> | |
{children} | |
</div> | |
); | |
} | |
export default Container; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure to add this to your
Components
folder & re use when you want to wrap elements according to the screen size.Example