Skip to contentSkip to navigationSkip to topbar
Paste assistant Assistant
Figma
Star

Box

Version 10.3.0GithubStorybook

The Box primitive is one of the pillars of our system. It can be any HTML element and can receive many of our token values as props. We use Box to build most of our other components.

Installation

Installation page anchor
yarn add @twilio-paste/box - or - yarn add @twilio-paste/core
import {Box} from '@twilio-paste/core/box';

const Component = () => (
  <Box
    as="article"
    backgroundColor="colorBackgroundBody"
    padding="space60"
    _hover={{
      backgroundColor: "colorBackgroundPrimary"
      padding: "space70"
    }}
  >
    Foo
  </Box>
);

Box

Box page anchor

__moz_focus_inner

Type
BoxBaseStyleProps

__webkit_calendar_picker_indicator_hover

Type
BoxBaseStyleProps

__webkit_datetime_edit

Type
BoxBaseStyleProps

__webkit_inner_spin_button

Type
BoxBaseStyleProps

__webkit_outer_spin_button

Type
BoxBaseStyleProps

_active

Type
BoxBaseStyleProps

_after

Type
BoxBaseStyleProps

_before

Type
BoxBaseStyleProps

_checked

Type
BoxBaseStyleProps

_checked_hover

Type
BoxBaseStyleProps

_disabled

Type
BoxBaseStyleProps

_disabled_focus

Type
BoxBaseStyleProps

_disabled_focus_after

Type
BoxBaseStyleProps

_even

Type
BoxBaseStyleProps

_expanded

Type
BoxBaseStyleProps

_first

Type
BoxBaseStyleProps

_focus

Type
BoxBaseStyleProps

_focus_hover

Type
BoxBaseStyleProps

_focus_placeholder

Type
BoxBaseStyleProps

_focus_selected_after

Type
BoxBaseStyleProps

_focus_selected_hover_after

Type
BoxBaseStyleProps

_focusVisible

Type
BoxBaseStyleProps

_focusWithin

Type
BoxBaseStyleProps

_grabbed

Type
BoxBaseStyleProps

_groupHover

Type
BoxBaseStyleProps

_hover

Type
BoxBaseStyleProps

_invalid

Type
BoxBaseStyleProps

_last

Type
BoxBaseStyleProps

_mixed

Type
BoxBaseStyleProps

_notFirst

Type
BoxBaseStyleProps

_notLast

Type
BoxBaseStyleProps

_odd

Type
BoxBaseStyleProps

_placeholder

Type
BoxBaseStyleProps

_pressed

Type
BoxBaseStyleProps

_pressed_active

Type
BoxBaseStyleProps

_pressed_disabled

Type
BoxBaseStyleProps

_pressed_focus

Type
BoxBaseStyleProps

_pressed_hover

Type
BoxBaseStyleProps

_readOnly

Type
BoxBaseStyleProps

_selected

Type
BoxBaseStyleProps

_selected_after

Type
BoxBaseStyleProps

_selected_focus

Type
BoxBaseStyleProps

_selected_focusVisible

Type
BoxBaseStyleProps

_selected_hover

Type
BoxBaseStyleProps

_selected_hover_after

Type
BoxBaseStyleProps

_visited

Type
BoxBaseStyleProps

accept

Same as HTML

Type
string

alt

Same as HTML

Type
string

as

Controls the HTML element that that will be rendered in the DOM.

Type
keyof IntrinsicElements

datetime

Same as HTML

Type
string

disabled

Same as HTML

Type
boolean

element

Used to set a custom element name for customization.

Type
string

href

Same as HTML

Type
string

label

Same as HTML

Type
string

multiple

Same as HTML

Type
boolean

rel

Same as HTML

Type
string

src

Same as HTML

Type
string

target

Same as HTML

Type
string

type

Same as HTML

Type
string

variant

Used to style custom variants via customization.

Type
string