Skip to content
Vy logo
  • Spor
  • Resources
Components

Box

Box is the foundational building block for all components in Spor.

GitHubReact Native

Code examples

<Box backgroundColor="mint">
  A simple box
</Box>

Guidelines

Box is a pretty special component. You can think of it as a <div /> that you can style using props and design tokens.

Code

<Box />

import { Box } from "@vygruppen/spor-react";

The base element in our design system. Used to make anyting based on design tokens. Can be thought of as a div.

There are a lot of props to use. Use autocompletion for a complete list.

Props

Name
Type
Required?
Description
backgroundColorstring
borderRadius"none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "round"
asstring | React.ComponentTypeLets you change the underlying DOM element rendered
colorstringText color
boxShadow"none" | "sm" | "md" | "lg"
heightstring
widthstring
marginnumberAlso marginTop, marginRight, marginBottom, marginLeft, marginX and marginY (marginHorizontal and marginVertical in React Native)
paddingnumberAlso paddingTop, paddingRight, paddingBottom, paddingLeft, paddingX and paddingY (paddingHorizontal and paddingVertical in React Native)
zIndex"hide" | "base" | "docked" | "dropdown" | "sticky" | "banner" | "overlay" | "modal" | "popover" | "skipLink" | "toast" | "tooltip"