Skip to content

Instantly share code, notes, and snippets.

@windse7en
Last active February 13, 2017 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save windse7en/d6c8992e79363a9d9b31d133737b5950 to your computer and use it in GitHub Desktop.
Save windse7en/d6c8992e79363a9d9b31d133737b5950 to your computer and use it in GitHub Desktop.
Grid with attributes format
import React, { PropTypes } from 'react';
import GridRow from '../src/GridRow';
import GridColumn from '../src/GridColumn';
import '../src/grid.scss';
const propTypes = {
children: PropTypes.node.isRequired,
};
const Grid = props => (<div {...props} />);
Grid.propTypes = propTypes;
Grid.Row = GridRow;
Grid.Column = GridColumn;
export default Grid;
// Consuming
import Gird from 'terra-grid';
<Grid>
<Grid.Row>
<Grid.Column>
<p>test</p>
</Grid.Column>
</Grid.Row>
</Grid>
// Consuming with alias
import Grid from 'terra-grid';
const Row = Grid.Row;
const Col = Grid.Column;
<Grid>
<Row>
<Col>
<p>test</p>
</Col>
</Row>
</Grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment