Skip to content

hannanhafeez/parent-div-scales-child-to-fit-in

Repository files navigation

Parent element scales and fits child element (React)

Demo

This is a React/Next.js demo project which shows how you can scale child element in parent to fit vertically or horizontally. The resize happens on windo resize event.

Refer page/index.tsx and page/index.module.css to see parent and child styles and hooks/useChildScaleToFirParent.ts to understand the logic of scaling for different orientaion combinations for both parent and child.

Demo here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published