All Projects → jameslnewell → Styled Components Grid

jameslnewell / Styled Components Grid

Licence: mit
A responsive grid components for styled-components.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Styled Components Grid

Styled Bootstrap Components
The bootstrap components made with styled-components 💅
Stars: ✭ 196 (-10.09%)
Mutual labels:  grid, styled-components
Styled Css Grid
🍱 A tiny CSS grid layout for React
Stars: ✭ 562 (+157.8%)
Mutual labels:  grid, styled-components
React Datepicker
An easily internationalizable, accessible, mobile-friendly datepicker library for the web, build with styled-components.
Stars: ✭ 252 (+15.6%)
Mutual labels:  grid, styled-components
rebass
⚛️ React primitive UI components built with styled-system.
Stars: ✭ 7,844 (+3498.17%)
Mutual labels:  grid, styled-components
Re Jok
A React UI Component library built with styled-components
Stars: ✭ 102 (-53.21%)
Mutual labels:  grid, styled-components
Gridiron
Feature-Packed React Grid Framework
Stars: ✭ 8 (-96.33%)
Mutual labels:  grid, styled-components
React Styled Flexboxgrid
Grid system based on styled-components and flexbox for React
Stars: ✭ 515 (+136.24%)
Mutual labels:  grid, styled-components
React Awesome Styled Grid
A responsive 8-point grid system layout for React using styled-components
Stars: ✭ 157 (-27.98%)
Mutual labels:  grid, styled-components
Griz
Grid library for React; Rescue the cat
Stars: ✭ 99 (-54.59%)
Mutual labels:  grid, styled-components
React Rasta
React Rasta is a powerful and flexible grid system for React
Stars: ✭ 88 (-59.63%)
Mutual labels:  grid, styled-components
React Flexa
Responsive React Flexbox (CSS Flexible Box Layout Module) grid system based heavily on the standard CSS API.
Stars: ✭ 120 (-44.95%)
Mutual labels:  grid, styled-components
Grid
This package has moved and renamed
Stars: ✭ 2,079 (+853.67%)
Mutual labels:  grid, styled-components
Styled React Boilerplate
Minimal & Modern boilerplate for building apps with React & styled-components
Stars: ✭ 198 (-9.17%)
Mutual labels:  styled-components
React Grid Layout
A draggable and resizable grid layout with responsive breakpoints, for React.
Stars: ✭ 14,732 (+6657.8%)
Mutual labels:  grid
Gridcal
GridCal, a cross-platform power systems solver written in Python with user interface and embedded python console
Stars: ✭ 197 (-9.63%)
Mutual labels:  grid
Music163 React
🔥基于React全家桶开发:「网易云音乐PC端项目」实战
Stars: ✭ 209 (-4.13%)
Mutual labels:  styled-components
Vue Easytable
🍉 Table Component/ Data Grid / Data Table.Support Virtual Scroll,Column Fixed,Header Fixed,Header Grouping,Filter,Sort,Cell Ellipsis,Row Expand,Row Checkbox ...
Stars: ✭ 2,501 (+1047.25%)
Mutual labels:  grid
Reactour
Tourist Guide into your React Components
Stars: ✭ 2,782 (+1176.15%)
Mutual labels:  styled-components
Grd
A CSS grid framework using Flexbox. Only 321 bytes (Gzipped).
Stars: ✭ 2,210 (+913.76%)
Mutual labels:  grid
Css In Js
Autocomplete React Native / JS Styles and converting plain CSS to JS styles
Stars: ✭ 192 (-11.93%)
Mutual labels:  styled-components

styled-components-grid

npm npm bundle size (minified + gzip) npm Build Status

Responsive grid components for styled-components 💅.

Change log

Have a look 👀 at styled-components-breakpoint and styled-components-spacing which work well with this package.

Installation

yarn add styled-components styled-components-grid

Usage

Examples

Using the default breakpoints

import React from 'react';
import Grid from 'styled-components-grid';

<Grid>
  <Grid.Unit size={1 / 6}>Awesome!</Grid.Unit>
  <Grid.Unit size={1 / 3}>Amazing!</Grid.Unit>
  <Grid.Unit size={{ tablet: 1 / 2, desktop: 1 / 4 }}>Out of this world!</Grid.Unit>
</Grid>;

Using custom breakpoints

You can customise the default breakpoints. If you would like to use the same breakpoints as Bootstrap, you can do so like this:

import React from 'react';
import { ThemeProvider } from 'styled-components';
import Grid from 'styled-components-grid';

const theme = {
  breakpoints: {
    xs: 0,
    sm: 576,
    md: 768,
    lg: 992,
    xl: 1200
  }
};

<ThemeProvider theme={theme}>
  <Grid>
    <Grid.Unit size={1 / 6}>Awesome!</Grid.Unit>
    <Grid.Unit size={1 / 3}>Amazing!</Grid.Unit>
    <Grid.Unit size={{ lg: 1 / 5 }}>Out of this world!</Grid.Unit>
  </Grid>
</ThemeProvider>;

Using the mixins

import React from 'react';
import styled from 'styled-components';
import { grid } from 'styled-components-grid';

const FeaturePanel = styled`
  ${grid({})}
`;

const Feature = styled`
  ${grid.unit({ size: { tablet: 1 / 3 } })}
`;

<FeaturePanel>
  <Feature>Awesome!</Feature>
  <Feature>Amazing!</Feature>
  <Feature>Out of this world!</Feature>
</FeaturePanel>;

Components

<Grid/>

horizontalAlign

Controls the horizontal alignment of grid units.

A string equal to one of left|right|center|justify|justify-center OR an object where the values are strings equal to one of left|right|center|justify|justify-center for each desired breakpoint. Defaults to left.

verticalAlign

Controls the vertical alignment of grid units.

A string equal to one of top|bottom|center|stretch OR an object where the values are strings equal to one of top|bottom|center|stretch for each desired breakpoint. Defaults to stretch.

reverse

Reverse the order of the grid units.

A boolean OR an object where the values are booleanss for each desired breakpoint. Defaults to false.

wrap

Whether the grid units should wrap across multiple lines or a single line.

A boolean OR an object where the values are booleanss for each desired breakpoint. Defaults to true.

component

The component to render the styles on.

Optional. A string or valid React component. Defaults to div.

<Grid.Unit/>

size

Controls the width of the grid unit.

A number between 0 and 1 OR a string of min or max OR an object where the values are a number between 0 and 1 OR a string of min or max for each desired breakpoint.

visible

Controls whether the grid unit is visible.

A boolean OR an object where the values are booleanss for each desired breakpoint. Defaults to true.

component

The component to render the styles on.

Optional. A string or valid React component. Defaults to div.

Mixins

grid(opts)

Apply grid styles.

  • halign
  • valign
  • wrap
  • reverse

grid.unit(opts)

Apply grid unit styles.

  • size
  • visible
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].