Giter Club home page Giter Club logo

react-css-grid-layout's Introduction

WARNING: Don't use this unless you know your environment supports CSS Grid Layout!

react-css-grid-layout

React components for wrapping your other react components in CSS Grid Layout inline.

Installation

npm install react-css-grid-layout

Quick Start

Maybe do something like this:

import React from 'react'
import { GridContainer, GridItem } from '../src'

export default function Layout () {
  return (
    <GridContainer rowTemplate='100px 1fr 1fr'
                   columnTemplate=`300px 25px 300px`
                   style={{ height: '100%' }}>
      <GridItem rows='2 / 3' columns='3 / 4'>
        <p>Content</p>
      </GridItem>
      <GridItem rows='1 / 4' columns='1 / 2' style={{ overflowY: 'scroll' }}>
        <h1>Sidebar</h1>
      </GridItem>
    </GridContainer>
  )
}

API

<GridContainer />

props (all optional)

Most of the properties are just one-to-one mappings onto the CSS properties. See Resources for more information on using the spec.

Component Property CSS property
rowTemplate: string grid-template-rows
columnTemplate: string grid-template-columns
areasTemplate: string grid-area-templates

style: object

Will be added to the inline styles of the <div> that surrounds your children. Any property you pass will override those set by react-css-grid-layout.

<GridItem />

props (all optional)

Most of the properties are just one-to-one mappings onto the CSS properties.

Component Property CSS property
area: string grid-area
rowStart: number grid-row-start
rowEnd: number grid-row-end
rows: string grid-row
columnStart: number grid-column-start
columnEnd: number grid-column-end
columns: string grid-column

style: object

Will be added to the inline styles of the <div> that surrounds your children. Any property you pass will override those set by react-css-grid-layout.

Resources for information about CSS Grid Layout

react-css-grid-layout's People

Contributors

dlmanning avatar

Watchers

James Cloos avatar Zeb Pykosz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.