All Projects → rebassjs → extras

rebassjs / extras

Licence: other
Reference components for using styled-system to build custom styled components

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to extras

elemental-react
Build UI components once, render to any platform: web, React Native and Sketch.
Stars: ✭ 21 (+31.25%)
Mutual labels:  styled-system
ui
The Blockstack design system implemented with react, styled-components, and styled-system.
Stars: ✭ 34 (+112.5%)
Mutual labels:  styled-system
gatsby-starter-redux-saas
An Gatsby starter for Saas products. Uses redux and apollo and a graphql token auth backend.
Stars: ✭ 18 (+12.5%)
Mutual labels:  styled-system
react-native-template
An opinionated template to bootstrap your next React Native app with all the time-wasting packages you need to have.
Stars: ✭ 132 (+725%)
Mutual labels:  styled-system
next-ts-starter
A Next.JS powered Typescript starter with styled components, styled-system, framer motion, jest and cypress
Stars: ✭ 27 (+68.75%)
Mutual labels:  styled-system
Grid
This package has moved and renamed
Stars: ✭ 2,079 (+12893.75%)
Mutual labels:  styled-system
Xstyled
A utility-first CSS-in-JS framework built for React. 💅👩‍🎤⚡️
Stars: ✭ 1,835 (+11368.75%)
Mutual labels:  styled-system
styled-system-figma
Generate theme.js from Figma file
Stars: ✭ 26 (+62.5%)
Mutual labels:  styled-system
web-starter-kit
An opinionated starter kit with styled-system, graphql-hooks, mobx and nextjs (PWA)
Stars: ✭ 17 (+6.25%)
Mutual labels:  styled-system
next-ts-graphql-apollo-starter
An opiniated Next powered starter which include support for Apollo with GraphQL SSR support, codegen, styled component / system, framer motion and Cypress
Stars: ✭ 18 (+12.5%)
Mutual labels:  styled-system
veel
Base react styling components using fela with a design system
Stars: ✭ 26 (+62.5%)
Mutual labels:  styled-system
klee
A personnal UI library made as an excuse to have a published UI package
Stars: ✭ 19 (+18.75%)
Mutual labels:  styled-system
rebass
⚛️ React primitive UI components built with styled-system.
Stars: ✭ 7,844 (+48925%)
Mutual labels:  styled-system
color-system
🎨 Easiest way to get a universal color palette
Stars: ✭ 21 (+31.25%)
Mutual labels:  styled-system

Rebass Extras

Reference components for using styled-system to build custom styled components. Copy and paste these components and customize them however you see fit.

Hide

import React from 'react'
import styled from 'styled-components'
import { display } from 'styled-system'
import hoistStatics from 'hoist-non-react-statics'
import { Box } from 'rebass'

const mapProps = map => Component =>
  hoistStatics(props => <Component {...map(props)} />, Component)

export const Base = styled(Box)(display)

export const Hide = mapProps(({
  xsmall,
  small,
  medium,
  large,
  xlarge,
  display,
  ...props,
}) => ({
  display: display || [
    xsmall,
    small,
    medium,
    large,
    xlarge
  ].map(n => n ? 'none' : 'block'),
  ...props,
}))(Base)

export default Hide
<Hide xsmall small />

Position

import styled from 'styled-components'
import {
  position,
  zIndex,
  top,
  right,
  bottom,
  left,
} from 'styled-system'
import { Box } from 'rebass'

export const Position = styled(Box)(
  position,
  zIndex,
  top,
  right,
  bottom,
  left
)

export const Relative = styled(Position)([])

Relative.defaultProps = {
  position: 'relative'
}

export const Absolute = styled(Position)([])

Absolute.defaultProps = {
  position: 'absolute'
}

export const Fixed = styled(Position)([])

Fixed.defaultProps = {
  position: 'fixed'
}

export const Sticky = styled(Position)([])

Sticky.defaultProps = {
  position: 'sticky'
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].