#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.

Hello world!

#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%.

Hello world!
Hello world!

#Alignment

By default, a container is aligned to the center, however its alignment can be left or right aligned with the align prop.

Hello world!
Hello world!

#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.

Hello world!

#Container Props

align "left" | "right" | "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 "left" | "right" | "center"

alignY "bottom" | "top" | "center"

altitude string

variant string

colorMode string

disabled boolean

overrides

{
  useCSSVariables?: boolean;
  altitudes?: AltitudesThemeConfig;
  borders?: BordersThemeConfig;
  borderRadii?: BorderRadiiThemeConfig;
  ... 94 more ...;
  Template?: TemplateThemeConfig;
}

elementRef ((instance: any) => void) | RefObject<any>

themeKey string

#Theming

Container.styles.base
Hello world
Container.styles.fluid
Hello world
Container.styles.layout
Hello world
Copyright © 2020 Jake Moxey