Container#
Import#
import { Container } from 'bumbag';
Usage#
A container's max width is fixed, and varies per viewport breakpoint.
A container's max width is defined for viewport widths of tablet (768px) and above. For widths below tablet (768px), a left and right margin is applied.
Fixed width#
A container's max width can be fixed after a certain breakpoint, meaning until that breakpoint has been reached, the width will be 100%.
Alignment#
By default, a container is aligned to the center, however its alignment can be left or right aligned with the align prop.
Fluid containers#
A fluid container's width is always 100%, but has a fixed left and right margin of 2rem (2 * root font size 16px). For devices under the tablet (768px) viewport, the margin is 1rem.
Container Props#
align "right" | "left" | "center"
Sets the alignment of the container.
breakpoint
(string & {})
| "tablet"
| "mobile"
| "fullHD"
| "widescreen"
| "desktop"Sets the breakpoint width of the container.
isFluid boolean
Indicates if the container is fluid.
isLayout boolean
Indicates if the container is of a layout type.
Inherits Box props
use
string
| (ComponentClass<any, any> & { useProps: any; })
| (FunctionComponent<any> & { useProps: any; })className string
children
string
| number
| boolean
| {}
| ReactElement<any, string
| ((props: any) => ReactElement<any, string
| ...
| (new (props: any) => Component<any, any, any>)>)
| (new (props: any) => Component<...>)>
| ReactNodeArray
| ReactPortal
| ((props: BoxProps) => ReactNode)alignX "right" | "left" | "center"
alignY "top" | "bottom" | "center"
variant string
colorMode string
disabled boolean
overrides
{
useCSSVariables?: boolean;
altitudes?: AltitudesThemeConfig;
borders?: BordersThemeConfig;
borderRadii?: BorderRadiiThemeConfig;
... 95 more ...;
Template?: TemplateThemeConfig;
}elementRef ((instance: any) => void) | RefObject<any>
themeKey string
Theming#
Container.styles.baseContainer.styles.fluidContainer.styles.layout