Rebass is a React UI component library that uses inline styles to avoid CSS dependencies and prevent leaky global styles from affecting an application. Rebass components inherit styles where appropriate and can be customized using React Context. Rebass components are built as stateless functional components and modeled as presentational components. With unit tests for each component, Rebass is great for prototyping and ready for production.
View the demo or read the component documentation below to get started.
Note: this page is statically rendered and does not have client-side JavaScript. To see interactive examples, View the demo.
npm i rebass
Arrow
Arrow for use in dropdowns and other UI elements
<Button
backgroundColor="primary"
color="white"
inverted={true}
rounded={true}
>
Arrow
<Arrow direction="down" />
</Button>| Prop | Type | Description |
|---|---|---|
| direction ('down') | oneOf(['up', 'down']) | Direction of arrow |
Avatar
A circular image for displaying user avatars
<Avatar
circle={true}
size={48}
src="http://lorempixel.com/64/64/cats"
/>| Prop | Type | Description |
|---|---|---|
| size (48) | number | Width and height of image in pixels |
Badge
Component for displaying small status indicators
Rebass
Pill
Circular
<Flex align="center">
<Heading level={4}>
Rebass
</Heading>
<Space x={1} />
<Badge
rounded={true}
theme="info"
>
0.2.0
</Badge>
<Space x={2} />
<Heading level={4}>
Pill
</Heading>
<Space x={1} />
<Badge
pill={true}
rounded={true}
theme="info"
>
Pill
</Badge>
<Space x={2} />
<Heading level={4}>
Circular
</Heading>
<Space x={1} />
<Badge
circle={true}
rounded={true}
theme="error"
>
4
</Badge>
</Flex>| Prop | Type | Description |
|---|---|---|
| theme ('default') | oneOf(['primary', 'secondary', 'default', 'info', 'success', 'warning', 'error']) | Sets color based on theme |
| rounded (true) | oneOfType([bool, oneOf(['top', 'right', 'bottom', 'left'])]) | Controls border radius |
| pill | bool | Sets pill style border radii |
| circle | bool | Sets width and border radius for circular badges |
Banner
Full-height banner with styling for background images
Rebass
<Banner
align="center"
backgroundImage="https://d262ilb51hltx0.cloudfront.net/max/2000/1*DZwdGMaeu-rvTroJYui6Uw.jpeg"
>
<Heading
level={2}
size={0}
>
Rebass
</Heading>
</Banner>| Prop | Type | Description |
|---|---|---|
| align ('center') | oneOf(['left', 'center', 'right']) | Horizontal alignment |
| backgroundImage | string | Background image source |
Block
Generic box with visual styling
Block
Generic box for containing things
<Block
borderLeft={true}
color="blue"
px={2}
>
<Media img="http://placehold.it/128/08e/fff">
<Heading
level={2}
size={0}
>
Block
</Heading>
<Text>
Generic box for containing things
</Text>
</Media>
</Block>| Prop | Type | Description |
|---|---|---|
| color | string | Text color - can either be a key from the config colors object or any color value |
| backgroundColor | string | Background color - can either be a key from the config colors object or any color value |
| borderColor | string | Border color - can either be a key from the config colors object or any color value |
| border | bool | Adds a border |
| borderTop | bool | Adds a border to the top side |
| borderRight | bool | Adds a border to the right side |
| borderBottom | bool | Adds a border to the bottom side |
| borderLeft | bool | Adds a border to the left side |
| m | oneOf([0, 1, 2, 3, 4]) | Applies margin with the margin utility based on the spacing scale |
| mt | oneOf([0, 1, 2, 3, 4]) | Applies margin top based on the spacing scale |
| mr | oneOf([0, 1, 2, 3, 4]) | Applies margin right based on the spacing scale |
| mb | oneOf([0, 1, 2, 3, 4]) | Applies margin bottom based on the spacing scale |
| ml | oneOf([0, 1, 2, 3, 4]) | Applies margin left based on the spacing scale |
| mx | oneOf([0, 1, 2, 3, 4]) | Applies margin left and right based on the spacing scale |
| my | oneOf([0, 1, 2, 3, 4]) | Applies margin top and bottom based on the spacing scale |
| p | oneOf([0, 1, 2, 3, 4]) | Applies padding with the padding utility based on the spacing scale |
| pt | oneOf([0, 1, 2, 3, 4]) | Applies padding top based on the spacing scale |
| pr | oneOf([0, 1, 2, 3, 4]) | Applies padding right based on the spacing scale |
| pb | oneOf([0, 1, 2, 3, 4]) | Applies padding bottom based on the spacing scale |
| pl | oneOf([0, 1, 2, 3, 4]) | Applies padding left based on the spacing scale |
| px | oneOf([0, 1, 2, 3, 4]) | Applies padding left and right based on the spacing scale |
| py | oneOf([0, 1, 2, 3, 4]) | Applies padding top and bottom based on the spacing scale |
| rounded | oneOfType([bool, oneOf(['top', 'right', 'bottom', 'left'])]) | Controls border radius |
Blockquote
Stylized blockquote element with citation link
In the sixteenth century, a series of common sizes developed among European typographers, and the series survived with little change and few additions for 400 years. […] Use the old familiar scale, or use new scales of your own devising, but limit yourself, at first, to a modest set of distinct and related intervals.
— Robert Bringhurst
<Blockquote href="http://webtypography.net/3.1.1" source="Robert Bringhurst" > In the sixteenth century, a series of common sizes developed among European typographers, and the series survived with little change and few additions for 400 years. […] Use the old familiar scale, or use new scales of your own devising, but limit yourself, at first, to a modest set of distinct and related intervals. </Blockquote>
| Prop | Type | Description |
|---|---|---|
| source | string | Name of source |
| href | string | URL link to source |
Breadcrumbs
Breadcrumb navigation links
<Breadcrumbs links={[{children: 'Jxnblk', href: '#!'}, {children: 'Rebass', href: '#!'}, {children: 'Breadcrumbs', href: '#!'}]} />| Prop | Type | Description |
|---|---|---|
| links* ([]) | array | Array of link props |
Button
A general purpose button element with customizable colors
<div>
<Button
backgroundColor="primary"
color="white"
inverted={true}
rounded={true}
>
Button
</Button>
</div>| Prop | Type | Description |
|---|---|---|
| href | string | Pass an href prop to make the Button an <a> tag instead of a <button> |
| color ('white') | string | Button color - can either be a key from the config colors object or any color value |
| backgroundColor ('primary') | string | Background color - can either be a key from the config colors object or any color value |
| rounded (true) | oneOfType([bool, oneOf(['top', 'right', 'bottom', 'left'])]) | Controls the border radius for creating button groups |
| pill | bool | Creates a pill style button |
| big | bool | Creates a larger button |
| theme | oneOf(['primary', 'secondary', 'default', 'info', 'success', 'warning', 'error']) | Sets color from config |
ButtonCircle
A circular button suited for use with icons
Example Icon component from react-geomicons
<Flex
align="center"
justify="space-between"
wrap={true}
>
<ButtonCircle title="Like">
<Icon
fill="currentColor"
height="1em"
name="heart"
width="1em"
/>
</ButtonCircle>
<ButtonCircle title="Comment">
<Icon
fill="currentColor"
height="1em"
name="chat"
width="1em"
/>
</ButtonCircle>
<ButtonCircle title="Repost">
<Icon
fill="currentColor"
height="1em"
name="repost"
width="1em"
/>
</ButtonCircle>
<ButtonCircle title="Bookmark">
<Icon
fill="currentColor"
height="1em"
name="bookmark"
width="1em"
/>
</ButtonCircle>
<ButtonCircle title="Tag">
<Icon
fill="currentColor"
height="1em"
name="tag"
width="1em"
/>
</ButtonCircle>
<Text small={true}>
Example Icon component from react-geomicons
</Text>
</Flex>| Prop | Type | Description |
|---|---|---|
| href | string | Pass an href prop to make the ButtonCircle an <a> tag instead of a <button> |
| color | string | Text color - can either be a key from the config colors object or any color value |
| backgroundColor | string | Background color - can either be a key from the config colors object or any color value |
| size | number | Sets width and height of button |
ButtonOutline
A general purpose outline style button element with customizable colors
<div>
<ButtonOutline
color="primary"
inverted={false}
rounded="left"
>
Button
</ButtonOutline>
<ButtonOutline
color="primary"
inverted={false}
rounded={false}
style={{marginLeft: -1}}
>
Group
</ButtonOutline>
<Button
backgroundColor="primary"
color="white"
inverted={true}
rounded="right"
style={{marginLeft: -1}}
>
Button
</Button>
</div>| Prop | Type | Description |
|---|---|---|
| href | string | Pass an href prop to make the ButtonOutline an <a> tag instead of a <button> |
| color ('primary') | string | Text color |
| rounded (true) | oneOfType([bool, oneOf(['top', 'right', 'bottom', 'left'])]) | Controls the border radius for creating button groups |
| pill | bool | Creates a pill style button |
| big | bool | Creates a larger button |
Card
Styled box with border
<Card
rounded={true}
width={256}
>
<CardImage src="http://placehold.it/320/08e/fff" />
<Heading
level={2}
size={3}
>
Card
</Heading>
<Text>
Cats like cards too
</Text>
</Card>| Prop | Type | Description |
|---|---|---|
| width | oneOfType([number, string]) | Width of card |
CardImage
Image for use within the Card component
<div style={{maxWidth: 192}}>
<CardImage src="http://placehold.it/320/08e/fff" />
</div>| Prop | Type | Description |
|---|---|---|
| src* | string | Image source |
Checkbox
Checkbox input with label
<div>
<Checkbox
label="Checkbox"
name="checkbox_1"
/>
<Checkbox
checked={true}
label="Checkbox"
name="checkbox_1"
readOnly={true}
theme="success"
/>
</div>| Prop | Type | Description |
|---|---|---|
| label* | string | Label for form element |
| name* | string | Name attribute for form element |
Close
A button with an × for close and dismiss actions
<Close />
Container
Div with max-width and margin auto for centering content
<Container> Container </Container>
Divider
Styled hr element
<div>
<Divider />
<Divider
ml={0}
width={128}
/>
</div>| Prop | Type | Description |
|---|---|---|
| width | number | Sets a fixed width for stylistic options |
Donut
A single-value donut chart with percentage
<Flex
align="center"
justify="space-between"
wrap={true}
>
<Donut
color="primary"
size={256}
strokeWidth={32}
value={0.5625}
/>
<Donut
color="primary"
size={128}
strokeWidth={8}
value={0.5625}
>
9/16
</Donut>
<Donut
color="primary"
size={128}
strokeWidth={8}
value={0.625}
/>
<Donut
color="primary"
size={128}
strokeWidth={8}
value={0.125}
/>
</Flex>| Prop | Type | Description |
|---|---|---|
| value (0) | number | Value from 0 to 1 |
| size (128) | number | Sets width and height |
| strokeWidth (8) | number | Sets width of stroke |
| color ('primary') | string | Text color - can either be a key from the config colors object or any color value |
DotIndicator
Dot indicator buttons for use in carousels
<div>
<DotIndicator
active={0}
length={3}
onClick={function noRefCheck() {}}
/>
</div>| Prop | Type | Description |
|---|---|---|
| length | number | Number of dot buttons to show |
| active | number | Index of the currently active dot |
| onClick (function () {}) | func | Click event callback - returns index of clicked button |
Drawer
An off-canvas drawer component
<a href="demo"> See demo </a>
| Prop | Type | Description |
|---|---|---|
| size (320) | number | Width or height of drawer, depending on placement |
| open (false) | bool | Shows and hides the drawer |
| position ('left') | oneOf(['top', 'right', 'bottom', 'left']) | Position relative to the viewport |
| onDismiss (function () {}) | func | Click event callback for the background overlay |
Dropdown
Position relative container for positioning DropdownMenu component
<Dropdown>
<Button
backgroundColor="primary"
color="white"
inverted={true}
rounded={true}
>
Dropdown
<Arrow direction="down" />
</Button>
<DropdownMenu
onDismiss={function noRefCheck() {}}
open={false}
>
<NavItem is="a">
Hello
</NavItem>
<NavItem is="a">
Hi
</NavItem>
</DropdownMenu>
</Dropdown>DropdownMenu
Absolutely positioned Menu component for use within Dropdown component
<a href="#Dropdown"> See Dropdown example </a>
| Prop | Type | Description |
|---|---|---|
| open (false) | bool | Toggles visibility of DropdownMenu |
| right | bool | Anchors menu to the right |
| top | bool | Anchors menu to the top |
| onDismiss (function () {}) | func | Click event callback for the background overlay |
Embed
Responsive media embed wrapper
<Embed ratio={0.5625}>
<iframe
allowFullScreen={true}
src="https://www.youtube.com/embed/KO_3Qgib6RQ"
/>
</Embed>| Prop | Type | Description |
|---|---|---|
| ratio (9 / 16) | number | Aspect ratio for the embed. Divide height over width to calculate. E.g. ratio={9/16} |
Fixed
Layout container for fixed positioning children
<a href="demo"> See demo </a>
| Prop | Type | Description |
|---|---|---|
| top | bool | Sets top: 0 |
| right | bool | Sets right: 0 |
| bottom | bool | Sets bottom: 0 |
| left | bool | Sets left: 0 |
| zIndex | number | Sets z-index |
Heading
Heading element with no margin and size based on fontSizes scale
| Prop | Type | Description |
|---|---|---|
| big | bool | Doubles the visual size - useful for marketing pages |
| level (2) | 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 |
| alt | bool | Applies alternate styling - useful for slugs and subheadings |
HeadingLink
Heading element with unstyled link. Useful for in-page navigation
| Prop | Type | Description |
|---|---|---|
| level (2) | oneOf([1, 2, 3, 4, 5, 6]) | Heading level, e.g. level={1} for <h1> |
| size | oneOf([1, 2, 3, 4, 5, 6]) | Visual size of heading |
| href ('#!') | string | href for link |
InlineForm
Inline grouped form for search or other simple forms
<InlineForm
buttonLabel="Go"
label="InlineForm"
name="inline_form"
onChange={function noRefCheck() {}}
onClick={function noRefCheck() {}}
/>| Prop | Type | Description |
|---|---|---|
| label* | string | Input label |
| name* | string | Input name |
| value | oneOfType([number, string]) | Input value |
| placeholder | string | Input placeholder |
| onChange (() => {}) | func | onChange handler for input |
| buttonLabel ('Go') | string | Text for button |
| onClick (() => {}) | func | onClick handler for button |
Input
Input element with label with support for aria-invalid, disabled, and readOnly HTML attributes
<Input
label="Input"
name="input_example"
placeholder="Placeholder"
rounded={true}
type="text"
/>| Prop | Type | Description |
|---|---|---|
| label* | string | Label for form element |
| name* | string | Name attribute for form element |
| type ('text') | string | Form element type |
| message | string | Adds a helper or error message below the input |
| hideLabel | bool | Hides the form element label |
| rounded (true) | oneOfType([bool, oneOf(['top', 'right', 'bottom', 'left'])]) | Controls the border radius for creating grouped elements |
Label
Label element for form controls
<Label> Label for form elements </Label>
| Prop | Type | Description |
|---|---|---|
| hide | bool | Accessibly hide label for use in high density UI. This can still cause accessibility issues. Use this with caution. |
LinkBlock
Unstyled display block link
LinkBlock
<LinkBlock
href="#LinkBlock"
is="a"
>
<Media
align="center"
img="http://placehold.it/96/08e/fff"
>
<Heading level={3}>
LinkBlock
</Heading>
</Media>
</LinkBlock>| Prop | Type | Description |
|---|---|---|
| is ('a') | oneOfType([string, object, func]) | Root component - useful for use with react-router's Link component |
| Component | oneOfType([string, object, func]) | Alias for `is` prop |
Media
Media object with vertical alignment using flexbox
Media Object
With alignment options
<Media
align="center"
img="http://placehold.it/128/08e/fff"
>
<Heading level={3}>
Media Object
</Heading>
<Text>
With alignment options
</Text>
</Media>| Prop | Type | Description |
|---|---|---|
| img | string | Image source |
| right | bool | Displays image to the right |
| align | oneOf(['top', 'center', 'bottom']) | Vertical alignment |
Menu
Menu component for navigation links and actions
<Menu rounded={true}>
<NavItem is="a">
Menu
</NavItem>
<NavItem is="a">
NavItem
</NavItem>
<NavItem is="a">
NavItem
</NavItem>
</Menu>| Prop | Type | Description |
|---|
Message
Component for displaying flash and error messages
<Message
inverted={true}
rounded={true}
theme="success"
>
Hello Message!
<Space
auto={true}
x={1}
/>
<Close />
</Message>| Prop | Type | Description |
|---|---|---|
| theme ('default') | oneOf(['primary', 'secondary', 'default', 'info', 'success', 'warning', 'error']) | Sets color from config |
Overlay
Fixed positioned overlay for use with modal dialogs
<a href="demo"> See demo </a>
| Prop | Type | Description |
|---|---|---|
| open (false) | bool | Shows and hides overlay |
| dark (true) | bool | Sets dark transparent overlay style |
| box | bool | Sets padding and background white for the content container |
| fullWidth | bool | Sets content container full width |
| onDismiss (function () {}) | func | Click event callback for the Overlay background |
PageHeader
Main page header with description
Page Header
Description about the page
<PageHeader description="Description about the page" heading="Page Header" />
| Prop | Type | Description |
|---|---|---|
| heading | string | Page heading |
| description | string | Description of page |
Panel
Panel for containing small pieces of information
Panels are great for visually separating UI, content, or data from the rest of the page.
<Panel theme="info">
<PanelHeader
inverted={true}
theme="default"
>
Panel
</PanelHeader>
<Text>
Panels are great for visually separating UI, content, or data from the rest of the page.
</Text>
<PanelFooter theme="default">
The footer is a good place for less important information
</PanelFooter>
</Panel>| Prop | Type | Description |
|---|---|---|
| theme ('default') | oneOf(['primary', 'secondary', 'default', 'info', 'success', 'warning', 'error']) | Sets color from config |
PanelHeader
Header for Panel component with vertical centering using flexbox
| Prop | Type | Description |
|---|---|---|
| theme ('default') | oneOf(['primary', 'secondary', 'default', 'info', 'success', 'warning', 'error']) | Sets color from config |
Pre
Pre element for displaying code examples
const pre = { preformatted: 'text' }<Pre>
const pre = { preformatted: 'text' }
</Pre>Progress
Progress element
<Progress
color="primary"
value={0.25}
/>| Prop | Type | Description |
|---|---|---|
| value | number | Value for progress bar |
| color ('primary') | string | Bar color - can either be a key from the config colors object or any color value |
Radio
Styled custom radio input with label
<div>
<Radio
checked={true}
circle={true}
group="radios"
label="Radio"
name="radio_1"
readOnly={true}
/>
<Radio
circle={true}
group="radios"
label="Radio"
name="radio_2"
/>
</div>| Prop | Type | Description |
|---|---|---|
| label* | string | Label for form element |
| name* | string | Name attribute for form element |
Rating
Star rating component with clickable buttons
<Rating
color="orange"
value={3.5}
/>| Prop | Type | Description |
|---|---|---|
| value (0) | number | Number of star rating from 1 to 5 |
| onClick | func | Click handler - returns index of star clicked |
Section
Section element with vertical padding
<Section> Section </Section>
SectionHeader
Header for section elements
Section Header
With linked header
<Section>
<SectionHeader
description="With linked header"
heading="Section Header"
/>
Section
</Section>| Prop | Type | Description |
|---|---|---|
| heading | string | Section heading |
| href | string | Link to section, used in HeadingLink |
| description | string | Description of section |
Select
Select form control with label
<Select
label="Select"
name="select_example"
options={[{children: 'Two', value: 2}, {children: 'Four', value: 4}, {children: 'Eight', value: 8}, {children: 'Sixteen', value: 16}, {children: 'Thirty-Two', value: 32}, {children: 'Sixty-Four', value: 64}]}
rounded={true}
/>| Prop | Type | Description |
|---|---|---|
| label* | string | Label for form element |
| name* | string | Name attribute for form element |
| options* ([]) | array | Options for select |
| message | string | Adds a helper or error message below the select |
| hideLabel | bool | Hides the form element label |
SequenceMap
Sequence map pattern for use in multi-step forms
<SequenceMap
active={1}
steps={[{children: 'Sign In', href: '#!'}, {children: 'Shipping Address', href: '#!'}, {children: 'Payment Method', href: '#!'}, {children: 'Place Order', href: '#!'}]}
/>| Prop | Type | Description |
|---|---|---|
| steps ([]) | array | Array of links for each step in the sequence |
| active | number | Index of current step |
SequenceMapStep
Subcomponent for use in SequenceMap
<a href="#SequenceMap"> See SequenceMap </a>
| Prop | Type | Description |
|---|---|---|
| width | string | Width of step |
| first | bool | Removes line from first step |
| active | bool | Sets primary color on active step |
Slider
Stylized range input with label
<div>
<Slider
defaultValue={37.5}
label="Slider"
name="slider_1"
/>
<Slider
color="blue"
fill={true}
label="Slider with color and fill"
name="slider_2"
readOnly={true}
value={62.5}
/>
</div>| Prop | Type | Description |
|---|---|---|
| label* | string | Label for form element |
| name* | string | Name attribute for form element |
| fill | bool | Adds a fill color to the track - requires client-side JavaScript |
| hideLabel | bool | Hides the form element label |
Space
Inline-block element for adding space between elements
<div>
<Button
backgroundColor="primary"
color="white"
inverted={true}
rounded={true}
>
Button
</Button>
<Space x={1} />
<Button
backgroundColor="primary"
color="white"
inverted={true}
rounded={true}
>
With
</Button>
<Space x={4} />
<Button
backgroundColor="primary"
color="white"
inverted={true}
rounded={true}
>
Space
</Button>
</div>| Prop | Type | Description |
|---|---|---|
| x (1) | oneOf([1, 2, 3, 4]) | Width of space based on the spacing scale |
| auto | bool | Sets flex: 1 1 auto |
Stat
Styled number display for statistics
<Flex
justify="space-between"
wrap={true}
>
<Stat
label="Memory"
unit="GB"
value="512"
/>
<Stat
label="PetaFLOPS"
value="32"
/>
<Stat
label="Upload"
unit="Mbps"
value="512"
/>
<Stat
label="Download"
unit="Mbps"
value="1,024"
/>
</Flex>| Prop | Type | Description |
|---|---|---|
| value | oneOfType([number, string]) | Value for stat shown in large font size |
| unit | string | Optional unit for displaying next to value |
| label | string | Label for stat |
| topLabel | bool | Displays label above value |
Switch
Binary toggle switch component
<Switch />
| Prop | Type | Description |
|---|---|---|
| checked | bool | Sets the Switch to an active style |
Table
Table element with simplified props
| Name | Meat | Vegetable | Carb |
|---|---|---|---|
| Hamburger | Beef | Onion | Bun |
| Pizza | Pork | Tomato | Crust |
| Corndog | Pork | Corn | Cornbread |
| Hot Dog | Pork | Peppers | Bun |
<Table
data={[['Hamburger', 'Beef', 'Onion', 'Bun'], ['Pizza', 'Pork', 'Tomato', 'Crust'], ['Corndog', 'Pork', 'Corn', 'Cornbread'], ['Hot Dog', 'Pork', 'Peppers', 'Bun']]}
headings={['Name', 'Meat', 'Vegetable', 'Carb']}
/>| Prop | Type | Description |
|---|---|---|
| headings ([]) | array | Headings for <th> |
| data ([]) | arrayOf | Array of table row data for <td> |
Text
Component for displaying text in UI
| Prop | Type | Description |
|---|---|---|
| small | bool | Sets a smaller font size |
| bold | bool | Sets bold font weight |
Textarea
Textarea form element with label
| Prop | Type | Description |
|---|---|---|
| label* | string | Label for form element |
| name* | string | Name attribute for form element |
| message | string | Adds a helper or error message below the textarea |
| hideLabel | bool | Hides the form element label |
Toolbar
Toolbar component that vertically centers children with display flex
<Toolbar>
<NavItem is="a">
Toolbar
</NavItem>
<NavItem is="a">
NavItem
</NavItem>
<Space
auto={true}
x={1}
/>
<NavItem is="a">
NavItem
</NavItem>
</Toolbar>Tooltip
Styled tooltip that shows on hover
Tooltip
<Tooltip
inverted={true}
rounded={true}
title="Hello!"
>
<Heading level={3}>
Tooltip
</Heading>
</Tooltip>| Prop | Type | Description |
|---|---|---|
| title | string | Text to display in tooltip |
Base
The Base component is internally used by all other Rebass components and provides an API to apply padding, margin, color, background-color, border-radius and other styles to any component. All props for the Base component are available to other Rebass components to help with contextual styling. It is not intended for use directly, but it can be used to create other custom components.
<Base
backgroundColor="black"
color="blue"
mb={3}
p={2}
rounded={true}
>
Base
</Base>| Prop | Type | Description |
|---|---|---|
| tagName | oneOfType([string, func, element]) | HTML element string or React component to render |
| className | string | Used to pull styles from the rebass context object |
| baseStyle | object | Base component styles |
| style | object | Styles from component instance - overrides base and context styles |
| m | oneOf([0, 1, 2, 3, 4]) | Applies margin with the margin utility based on the spacing scale |
| mt | oneOf([0, 1, 2, 3, 4]) | Applies margin top based on the spacing scale |
| mr | oneOf([0, 1, 2, 3, 4]) | Applies margin right based on the spacing scale |
| mb | oneOf([0, 1, 2, 3, 4]) | Applies margin bottom based on the spacing scale |
| ml | oneOf([0, 1, 2, 3, 4]) | Applies margin left based on the spacing scale |
| mx | oneOf([0, 1, 2, 3, 4]) | Applies margin left and right based on the spacing scale |
| my | oneOf([0, 1, 2, 3, 4]) | Applies margin top and bottom based on the spacing scale |
| p | oneOf([0, 1, 2, 3, 4]) | Applies padding with the padding utility based on the spacing scale |
| pt | oneOf([0, 1, 2, 3, 4]) | Applies padding top based on the spacing scale |
| pr | oneOf([0, 1, 2, 3, 4]) | Applies padding right based on the spacing scale |
| pb | oneOf([0, 1, 2, 3, 4]) | Applies padding bottom based on the spacing scale |
| pl | oneOf([0, 1, 2, 3, 4]) | Applies padding left based on the spacing scale |
| px | oneOf([0, 1, 2, 3, 4]) | Applies padding left and right based on the spacing scale |
| py | oneOf([0, 1, 2, 3, 4]) | Applies padding top and bottom based on the spacing scale |
| color | string | Text color - can either be a key from the config colors object or any color value |
| backgroundColor | string | Background color - can either be a key from the config colors object or any color value |
| theme | oneOf(['primary', 'secondary', 'default', 'info', 'success', 'warning', 'error']) | Sets color from config |
| inverted | bool | Inverts colors from theme |
| rounded | oneOfType([bool, oneOf(['top', 'right', 'bottom', 'left'])]) | Controls border radius |
| circle | bool | Sets border radius 99999 |
| pill | bool | Sets border radius 99999 |
Reflexbox
React flexbox layout and grid system
React Geomicons
React icon component for Geomicons