Box#
All components in Bumbag are built on top of the <Box>
primitive. Any component in Bumbag can use Box's props.
By default it renders a <div>
element with basic reset styles.
Import#
import { Box } from 'bumbag';
Usage#
Editable example
Alignments#
You can apply alignments to your Box
using the alignX
and alignY
props.
Horizontal align#
Editable example
Vertical align#
Editable example
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#
Box.styles.base
This is a box
On this page