Use Box...
- If you need a simple container with spacing.
- As the starting point of a component that understands the core SWAN props.
Don't use Box...
- If an existing SWAN component can be used instead.
React API
Box is available for React API only. It is the basic building-block of a SWAN component. It understands all SWANs core props like spacing, background color, and visuallyHidden.
The preview has been updated.
Vanilla API
Box is not available for Vanilla API. You can add the SWAN CSS classes to whatever HTML element you'd like, such as div
.
The preview has been updated.