Skip to Content

Box

A brandless generic container wrapping a <div>. Provides a CSS token surface for borders, background, padding, and shadow. Apply a modifier class to style it.

Demo

Content inside a Box.

Usage

import { Box } from '@froglet/ui' <Box>Content here.</Box> // Themed <Box className="box--brand"> <p>Content here.</p> </Box>

Props

PropTypeDescription
childrenReactNodeBox content.
classNamestringAdditional CSS classes. Use to apply a token block.
refReact.Ref<HTMLDivElement>Forwarded to the underlying <div>.
...propsHTMLAttributes<HTMLDivElement>All standard div attributes.

CSS Custom Properties

TokenDefaultDescription
--box-padding0Inner spacing.
--box-background-colortransparentBackground fill.
--box-border-width1pxBorder width.
--box-border-stylesolidBorder style.
--box-border-color#e5e7ebBorder color.
--box-border-radius4pxCorner rounding.
--box-shadownoneBox shadow.
Last updated on