W
Wasp3w ago
Juan

Layout

I would like to remove this constraint but not sure how to safely remove it. I have this screen but it seems that it is constrained to a container and I'm unable to utilize the whole screen. See screenshot and highlights. What do I need to overwrite so I can utilize max width and height.
No description
3 Replies
kapa.ai
kapa.ai3w ago
Hi @Juan. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources, the layout constraint you are experiencing is likely due to the structure and Tailwind CSS classes used in the layout component for authentication pages. The typical layout looks like this:
export function Layout({ children }) {
return (
<div className="w-full h-full bg-white">
<div className="min-w-full min-h-[75vh] flex items-center justify-center">
<div className="w-full h-full max-w-sm p-5 bg-white">
<div>{children}</div>
</div>
</div>
</div>
);
}
export function Layout({ children }) {
return (
<div className="w-full h-full bg-white">
<div className="min-w-full min-h-[75vh] flex items-center justify-center">
<div className="w-full h-full max-w-sm p-5 bg-white">
<div>{children}</div>
</div>
</div>
</div>
);
}
or, in TypeScript:
export function Layout({ children }: { children: React.ReactNode }) {
return (
<div className="w-full h-full bg-white">
<div className="min-w-full min-h-[75vh] flex items-center justify-center">
<div className="w-full h-full max-w-sm p-5 bg-white">
<div>{children}</div>
</div>
</div>
</div>
);
}
export function Layout({ children }: { children: React.ReactNode }) {
return (
<div className="w-full h-full bg-white">
<div className="min-w-full min-h-[75vh] flex items-center justify-center">
<div className="w-full h-full max-w-sm p-5 bg-white">
<div>{children}</div>
</div>
</div>
</div>
);
}
The constraint comes from the classes like max-w-sm, p-5, and the nested divs, which limit the width and center the content. To utilize the full width and height of the screen, you should: 1. Remove or adjust the max-w-sm class: This class restricts the maximum width of the container. 2. Consider removing extra wrapper divs: The nested structure and flex centering may also constrain your layout. For example, to make your content use the full available space, you could simplify the layout like this:
export function Layout({ children }) {
return (
<div className="w-full h-screen bg-white">
{children}
</div>
);
}
export function Layout({ children }) {
return (
<div className="w-full h-screen bg-white">
{children}
</div>
);
}
Or, if you want to keep some padding but remove the width constraint:
export function Layout({ children }) {
return (
<div className="w-full h-screen bg-white p-5">
{children}
</div>
);
}
export function Layout({ children }) {
return (
<div className="w-full h-screen bg-white p-5">
{children}
</div>
);
}
Summary:
Overwrite or modify the Layout component in your project (commonly found in src/pages/auth.tsx or similar) and remove the max-w-sm and unnecessary wrapper divs to allow your content to utilize the full width and height of the screen. This approach is consistent with the layout patterns shown in the Wasp documentation for authentication pages and general layout configuration Docs: Auth Email, Docs: Client Config. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Juan, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
toticozeni
toticozeni3w ago
Hey @Juan, for the width it's most likely that the container has a maximum width set. As for the height, the containers don't take up more space than needed by default. You would need to force it e.g. take up the whole screen of height. Did you manage to fix it? If you need help I'm here.
Juan
JuanOP3w ago
I have resolved it by removing the constraint in App.tsx. Thank you!

Did you find this page helpful?