<Container> Component
<Container> is a generic container with responsive padding width & height based on browser's width at certain breakpoints.
This component is great for creating <main> or <section> of your page.
<Container> Component<Container> is a generic container with responsive padding width & height based on browser's width at certain breakpoints.
This component is great for creating <main> or <section> of your page.
<Container> ComponentThere are 2 ways to install <Container> component into your react app project:
<Container> Component<Container> ComponentBy default the <Container>'s childen space is inside the <Container>'s padding.
But in some cases, you may want some children or sub <section>s to fill over the <Container>'s padding. For example: a hero section or highlighted sections. There are 2 special className to do that: 'fill' and 'fill-self'.
<Container>'s PaddingTo make the child element(s) or sub <section>(s) fills the <Container>'s padding, add a 'fill' to the child's className.
The child's padding itself is preserved as original, so the content alignment is shifted.
Here the demonstration:
className='fill'className='fill'When the child is located at the top or bottom, the 'fill' class removes the padding-top and/or padding-bottom of the <Container>.
className='fill'className='fill'<Container>'s PaddingTo make the child element(s) or sub <section>(s) takes over the <Container>'s padding, add a 'fill-self' to the child's className.
The child's padding copies (take over) the <Container>'s padding, so the content alignment is preserved.
Here the demonstration:
className='fill-self'className='fill-self'When the child is located at the top or bottom, the 'fill-self' class also takes over the padding-top and/or padding-bottom of the <Container>.
className='fill-self'className='fill-self'The alternative appearances of the <Container> layout without changing the <Container>'s functionality.
size PropertyDefines the alternative size of the <Container>.
The possible values are:
undefined'sm''md''lg'Here the preview:
theme PropertyDefines the contextual theme of the <Container>.
The possible values are:
undefined'primary''secondary''success''info''warning''danger''light''dark'Here the preview:
gradient PropertyActivates a 3D mode of the <Container>.
The possible values are:
undefined'inherit'truefalseHere the preview:
outlined PropertyActivates an outlined mode (background-less, contrast foreground, and contrast border) of the <Container>.
The possible values are:
undefined'inherit'truefalseHere the preview:
mild PropertyActivates a mild mode (mild background, contrast foreground, and contrast border) of the <Container>.
The possible values are:
undefined'inherit'truefalseHere the preview:
nude PropertyActivates an nude mode (background-less, padding-less, and border-less) of the <Container>.
The possible values are:
undefinedtruefalseHere the preview:
Because <Container> is made from <Basic>, so all properties from <Basic> are inherited.
There are several variables of <Container> you can customize. Changing the variables affects all <Container> instance and other components that depend on <Container>.
Here the exposed variables:
The example of accessing, modifying, & adding variables: