0.1.1 • Published 5 years ago

easy-responsive-container v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

ResponsiveContainer

A small lib to have a container that supports Bootstrap responsiveness using hooks (???)

What does it do?

It provides a ResponsiveContainer component that will display elements according to Bootstrap breakpoints and that will fall to children if the breakpoint is not specified in the props.

How to use it?

<ResponsiveContainer
  xs={<XSComponent />}
  sm={<SMComponent />}
  md={<MDComponent />}
  lg={<LGComponent />}
  xl={<XLComponent />}
>
  {<FallbackComponent />}
</ResponsiveContainer>

How it works?

<ResponsiveContainter /> adds an onResize listener and adapts rendring according to prefixed screen sizes (see useGetDeviceInfo.ts for more information)