RebassDemo
GitHubnpm
npm i rebass

Arrow

Arrow for use in dropdowns and other UI elements

Example
<Button rounded={true}>
  Arrow
  <Arrow direction="down" />
</Button>

Variations

PropTypeDescription
direction oneOf(['up', 'down'])Direction of arrow

Avatar

A circular image for displaying user avatars

Example
<Avatar
  size={48}
  src="http://lorempixel.com/64/64/cats"
/>
PropTypeDescription
size numberWidth and height of image in pixels

Badge

Component for displaying flash and error messages

Example

Rebass
0.2.0

<div>
  <Heading level={2}>
    Rebass
    <Space x={1} />
    <Badge type="info">
      0.2.0
    </Badge>
  </Heading>
</div>

Variations

Badge
Badge
Badge
Badge
Badge
PropTypeDescription
type oneOf(['default', 'info', 'success', 'warning', 'error'])Sets color based on type of badge

Block

Generic box with visual styling

Example

Block

Generic box for containing things

<Block
  borderLeft={true}
  color="blue"
>
  <Media img="http://lorempixel.com/128/128/cats">
    <Heading
      level={2}
      size={0}
    >
      Block
    </Heading>
    <Text>
      Generic box for containing things
    </Text>
  </Media>
</Block>
PropTypeDescription
color stringText color - can either be a key from the theme colors object or any color value
backgroundColor stringBackground color - can either be a key from the theme colors object or any color value
borderColor stringBorder color - can either be a key from the theme colors object or any color value
border boolAdds a border
borderTop boolAdds a border to the top side
borderRight boolAdds a border to the right side
borderBottom boolAdds a border to the bottom side
borderLeft boolAdds a border to the left side
m oneOf([0, 1, 2, 3, 4])Applies margin based on the theme spacing scale
mt oneOf([0, 1, 2, 3, 4])Applies margin top based on the theme spacing scale
mr oneOf([0, 1, 2, 3, 4])Applies margin right based on the theme spacing scale
mb oneOf([0, 1, 2, 3, 4])Applies margin bottom based on the theme spacing scale
ml oneOf([0, 1, 2, 3, 4])Applies margin left based on the theme spacing scale
mx oneOf([0, 1, 2, 3, 4])Applies margin left and right based on the theme spacing scale
my oneOf([0, 1, 2, 3, 4])Applies margin top and bottom based on the theme spacing scale

Button

A general purpose button element with customizable colors

Example
<div>
  <Button rounded={true}>
    Button
  </Button>
</div>

Variations

PropTypeDescription
href stringPass an href prop to make the Button an <a> tag instead of a <button>
color stringButton color - can either be a key from the theme colors object or any color value
backgroundColor stringBackground color - can either be a key from the theme colors object or any color value
rounded oneOfType([bool, oneOf(['top', 'right', 'bottom', 'left'])])Controls the border radius for creating button groups
big boolCreates a larger button

ButtonOutline

A general purpose outline style button element with customizable colors

Example
<div>
  <ButtonOutline rounded="left">
    Button
  </ButtonOutline>
  <ButtonOutline
    rounded={false}
    style={{marginLeft: -1}}
  >
    Group
  </ButtonOutline>
  <Button
    rounded="right"
    style={{marginLeft: -1}}
  >
    Button
  </Button>
</div>

Variations

PropTypeDescription
href stringPass an href prop to make the ButtonOutline an <a> tag instead of a <button>
color stringText color
rounded oneOfType([bool, oneOf(['top', 'right', 'bottom', 'left'])])Controls the border radius for creating button groups
big boolCreates a larger button

Card

Styled box with border

Example

Card

Cats like cards too

<Card width={256}>
  <CardImage src="http://placehold.it/320" />
  <Heading
    level={2}
    size={3}
  >
    Card
  </Heading>
  <Text>
    Cats like cards too
  </Text>
</Card>
PropTypeDescription
width oneOfType([number, string])Width of card

CardImage

Image for use within the Card component

Example
<div style={{maxWidth: 192}}>
  <CardImage src="http://placehold.it/320" />
</div>
PropTypeDescription
src *stringImage source

Checkbox

Checkbox input with label

Example
<Checkbox
  label="Checkbox"
  name="checkbox_example"
/>
PropTypeDescription
label *stringLabel for form element
name *stringName attribute for form element

Close

A button with an × for close and dismiss actions

Example
<Close />

Container

Div with max-width and margin auto for centering content

Example
Container
<Container>
  Container
</Container>

Divider

Styled hr element

Example

<Divider />
PropTypeDescription
compact boolRemoves margin top and bottom

Drawer

An off-canvas drawer component

Example
See Demo Page
<a href="demo">
  See Demo Page
</a>
PropTypeDescription
size numberWidth or height of drawer, depending on placement
open boolShows and hides the drawer
position oneOf(['top', 'right', 'bottom', 'left'])Position relative to the viewport

Embed

Responsive media embed wrapper

Example
<Embed ratio={0.5625}>
  <iframe
    allowFullScreen={true}
    src="https://www.youtube.com/embed/658WsCFwm9A"
  />
</Embed>
PropTypeDescription
ratio numberAspect ratio for the embed. Divide height over width to calculate. E.g. ratio={9/16}

Heading

Heading element with no margin and size based on fontSizes scale

Example

Variations

Heading

Heading

Heading

Heading

Heading
Heading
PropTypeDescription
level oneOf([1, 2, 3, 4, 5, 6])Heading level, e.g. level={1} for <h1>
size oneOf([0, 1, 2, 3, 4, 5, 6])Visual size of heading

Input

Input element with label

Example
<Input
  label="Input"
  name="input_example"
  placeholder="Placeholder"
  rounded={true}
  type="text"
/>

Variations

PropTypeDescription
label *stringLabel for form element
name *stringName attribute for form element
type stringForm element type
hideLabel boolHides the form element label
rounded oneOfType([bool, oneOf(['top', 'right', 'bottom', 'left'])])Controls the border radius for creating grouped elements

InputRange

Input type range with label

Example

Variations

PropTypeDescription
label *stringLabel for form element
name *stringName attribute for form element
hideLabel boolHides the form element label

Label

Label element for form controls

Example
<Label>
  Label for form elements
</Label>
PropTypeDescription
hide boolAccessibly hide label for use in high density UI. This can still cause accessibility issues. Use this with caution.

Media

Media object with vertical alignment using flexbox

Example

Media Object

With alignment options

<Media
  align="center"
  img="http://placehold.it/128"
>
  <Heading level={3}>
    Media Object
  </Heading>
  <Text>
    With alignment options
  </Text>
</Media>

Variations

Media
Media
Media
Media
Media
Media
PropTypeDescription
img stringImage source
right boolDisplays image to the right
align oneOf(['top', 'center', 'bottom'])Vertical alignment

Message

Component for displaying flash and error messages

Example
Hello Message!
<Message type="success">
  Hello Message!
  <Space
    auto={true}
    x={1}
  />
  <Close />
</Message>

Variations

Message
Message
Message
Message
Message
PropTypeDescription
type oneOf(['default', 'info', 'success', 'warning', 'error'])Sets color based on type of message

Panel

Panel for containing small pieces of information

Example
Panel

Panels are great for visually separating UI, content, or data from the rest of the page.

The footer is a good place for less important information
<Panel type="info">
  <PanelHeader type="default">
    Panel
  </PanelHeader>
  <Text>
    Panels are great for visually separating UI, content, or data from the rest of the page.
  </Text>
  <PanelFooter type="default">
    The footer is a good place for less important information
  </PanelFooter>
</Panel>

Variations

Panel
Panel
Panel
Panel
Panel
PropTypeDescription
type oneOf(['default', 'info', 'success', 'warning', 'error'])Sets border color based on type of panel

PanelFooter

Footer for Panel component with vertical centering using flexbox

Example

Variations

PanelFooter
PanelFooter
PanelFooter
PanelFooter
PanelFooter
PropTypeDescription
type oneOf(['default', 'info', 'success', 'warning', 'error'])Sets background color based on the type of panel

PanelHeader

Header for Panel component with vertical centering using flexbox

Example

Variations

PanelHeader
PanelHeader
PanelHeader
PanelHeader
PanelHeader
PropTypeDescription
type oneOf(['default', 'info', 'success', 'warning', 'error'])Sets background color based on the type of panel

Pre

Pre element for displaying code examples

Example
const pre = { preformatted: 'text' }
<Pre>
  const pre = { preformatted: 'text' }
</Pre>

Progress

Progress element

Example
0.25
<Progress value={0.25} />
PropTypeDescription
value numberValue for progress bar

Radio

Radio input with label

Example
<Radio
  label="Radio"
  name="radio_example"
/>
PropTypeDescription
label *stringLabel for form element
name *stringName attribute for form element

Section

Section element with vertical padding

Example
Section
<Section>
  Section
</Section>

SectionHeader

Header for section elements

Example

Section Header

With linked header

Section
<Section>
  <SectionHeader
    description="With linked header"
    heading="Section Header"
  />
  Section
</Section>
PropTypeDescription
heading stringSection heading
href stringLink to section, used in HeadingLink
description stringDescription of section

Select

Select form control with label

Example
<Select
  label="Select"
  name="select_example"
  options={[{label: 'Two', value: 2}, {label: 'Four', value: 4}, {label: 'Eight', value: 8}, {label: 'Sixteen', value: 16}, {label: 'Thirty-Two', value: 32}, {label: 'Sixty-Four', value: 64}]}
/>

Variations

PropTypeDescription
label *stringLabel for form element
name *stringName attribute for form element
options *arrayOptions for select
hideLabel boolHides the form element label

Space

Inline-block element for adding space between elements

Example
<div>
  <Button rounded={true}>
    Button
  </Button>
  <Space x={1} />
  <Button rounded={true}>
    With
  </Button>
  <Space x={4} />
  <Button rounded={true}>
    Space
  </Button>
</div>
PropTypeDescription
x oneOf([1, 2, 3, 4])Width of space based on the spacing scale
auto boolSets flex: 1 1 auto

Text

Component for displaying text in UI

Example

Variations

Text

Text

PropTypeDescription
small boolSets a smaller font size

Textarea

Textarea form element with label

Example

Variations

PropTypeDescription
label *stringLabel for form element
name *stringName attribute for form element
hideLabel boolHides the form element label

Toolbar

Toolbar component that vertically centers children with display flex

Example
<Toolbar>
  <NavItem Component="a">
    Toolbar
  </NavItem>
  <NavItem Component="a">
    NavItem
  </NavItem>
  <Space
    auto={true}
    x={1}
  />
  <NavItem Component="a">
    NavItem
  </NavItem>
</Toolbar>

Tooltip

Styled tooltip that shows on hover

Example

Tooltip

<Tooltip title="Hello!">
  <Heading level={3}>
    Tooltip
  </Heading>
</Tooltip>
PropTypeDescription
title stringText to display in tooltip

Get Started

GitHub

Documentation generated with react-docgen and react-component-permutations.