Basic usage

Use Box when there are no other options. It can accept all system props. Here is a basic example with color and spacing props applied. It also has flexbox applied with a nested box

import { Box } from '@houzz/ui';
Centering content
Override component

If you want to render a different tag or component, use the as polymorphic prop provided by styled-components. Some cases may call for forwardedAs.

import { Box } from '@houzz/ui';
Psuedo classes

houzz-ui does not have PsuedoBox support (yet). The team is evaluating how to integrate this into the library. For now, you can do:

Props

Box
System Props

  • COMMON
  • TYPOGRAPHY
  • BORDER
  • LAYOUT
  • POSITION
  • FLEX
  • GRID
  • Learn More
NameTypeDescription
gradientResponsiveValue<ReactText, Required<Theme<ReactText>>>-

Accessibility

  • The box component is a powerful layout tool, however, when using it make sure there is not a more HTML semantic option.
  • Since box will render a div by default, it provides no context to accessibility tools.
  • Read more about HTML semantics here.