Atomic Layout
  • Introduction
  • Motivation
  • Resources
  • FAQ
    • Comparison with styled-system
  • Getting started
    • Installation
    • First composition
    • Responsive composition
    • Nested composition
  • Fundamentals
    • Breakpoints
    • Prop aliases
    • Responsive props
  • API
    • Layout
      • configure()
    • Components
      • Box
      • Composition
      • Only
      • Visible
    • Hooks
      • useMediaQuery
      • useResponsiveQuery
      • useViewportChange
      • useBreakpointChange
      • useResponsiveValue
      • useResponsiveProps
    • Utilities
      • query
      • makeResponsive
  • Recipes
    • Semantics
    • Namespaces
    • Iterative areas
    • Responsive layout
    • Explicit media query
Powered by GitBook
On this page
  • Specification
  • Props
  • Example
  1. API
  2. Components

Box

Specification

Box is a primitive component that distributes alignment and spacing.

Box has no control over elements' composition. Use Composition instead.

Props

Box supports all Prop aliases, except those specific to CSS Grid.

Prop name

Type

Description

flex

boolean

Display a box as flex.

inline

boolean

Uses inline display.

Example

import React from 'react'
import { Box } from 'atomic-layout'

export const Header = ({ children }) => (
  <Box as="header" padding={10} paddingMd={20}>
    {children}
  </Box>
)

PreviousComponentsNextComposition

Last updated 5 years ago