Box
A box is a generic container that provides managed access to design tokens.Installation
| Install | yarn add @atlaskit/primitives |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/primitives, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Box also supports all valid props as specified by the HTML element type in the as prop. The
default is a div, so it would support all valid HTMLDivElement props.
Props
| Description | The DOM element to render as the Box.
|
|---|---|
| Default | 'div' |
| Type | "object" | "article" | "dialog" | "figure" | "form" | "img" | "link" | "main" | "menu" | "menuitem" | "option" | "search" | "table" | "label" | "style" | "abbr" | "address" | "area" | ... 99 more ... | "set"T |
| Description | Token representing background color with a built-in fallback value. |
|---|---|
| Type | "utility.elevation.surface.current" | "elevation.surface" | "elevation.surface.container" | "elevation.surface.overlay" | "elevation.surface.raised" | "elevation.surface.sunken" | ... 223 more ... | "elevation.surface.raised.pressed" |
| Description |
|
|---|---|
| Type | never |
| Description | Tokens representing CSS shorthand for @see paddingBlock
@see paddingInline
@private
– Do not use shorthand props, use |
|---|---|
| Type | "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | "space.1000" |
| Description | Tokens representing CSS shorthand @see paddingBlockStart
@see paddingBlockEnd
@private
– Do not use shorthand props, use |
|---|---|
| Type | "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | "space.1000" |
| Description | Tokens representing CSS |
|---|---|
| Type | "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | "space.1000" |
| Description | Tokens representing CSS |
|---|---|
| Type | "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | "space.1000" |
| Description | Tokens representing CSS shorthand @see paddingInlineStart @see paddingInlineEnd |
|---|---|
| Type | "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | "space.1000" |
| Description | Tokens representing CSS |
|---|---|
| Type | "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | "space.1000" |
| Description | Tokens representing CSS |
|---|---|
| Type | "space.0" | "space.025" | "space.050" | "space.075" | "space.100" | "space.150" | "space.200" | "space.250" | "space.300" | "space.400" | "space.500" | "space.600" | "space.800" | "space.1000" |
| Description | Forwarded ref. |
|---|---|
| Type | React.Ref<HTMLObjectElement> | React.Ref<HTMLElement> | React.Ref<HTMLDialogElement> | React.Ref<HTMLFormElement> | ... 57 more ... | React.Ref<...>ComponentPropsWithRef<T>["ref"] |
| Description | A unique string that appears as data attribute |
|---|---|
| Type | string |
| Description | Apply a subset of permitted styles powered by Atlassian Design System design tokens.
It's preferred you do not use |
|---|---|
| Type | false | (XCSSValue<"appearance" | "color" | "maxWidth" | "grid" | "borderColor" | "clipPath" | "filter" | "marker" | "mask" | "height" | "width" | "translate" | "content" | "border" | ... 486 more ... | "viewTimeline", DesignTokenStyles, ""> & ... 4 more ... & { ...; }) |