GitXplorerGitXplorer
a

layout-elements

public
5 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
63c48b8de76ffaf8592883eec1dccff2ebbea060

version 0.0.3

aalexeyraspopov committed 4 years ago
Verified
791086c76cd78d59e7d3048ed6062848a8c40edb

fix custom className overrides

aalexeyraspopov committed 4 years ago
Verified
4232922f68b4be8fe33e55360cc13bdb2419738b

set width and height for .scene-content

aalexeyraspopov committed 5 years ago
Unverified
ccd9a78cc205a3a328b222282020f1f5f22d56f8

more description

aalexeyraspopov committed 5 years ago
Unverified
f4c2329e54ca4749162c3709369f2bc1c01ffc32

fix scene children

aalexeyraspopov committed 5 years ago
Unverified
dd7002e7766b38cf1044ea07f600efc7db0794d9

layout-elements@0.0.1

aalexeyraspopov committed 5 years ago

README

The README file for this repository.

layout-elements

npm install layout-elements

Requirements

This package relies on and makes use of CSS Variables (Custom Properties) in runtime.

Rationale

Stack: abstraction on top of Flexbox for linear collections. No need to figure out justify-content/align-items values, etc.

Scene: a useful layer to force aspect ratio of an element.

Usage

import React from 'react';
import { Stack } from 'layout-elements';

function MyDataList({ items }) {
  return (
    <Stack direction="vertical" spacing={1} alignment="stretch">
      {items.map(item => (
        <MyItem data={item} />
      ))}
    </Stack>
  );
}
import React from 'react';
import { Scene } from 'layout-elements';

function MyDataVis() {
  return (
    <Scene aspectRatio={16 / 9} preserve>
      <svg>...</svg>
    </Scene>
  );
}

Make sure related stylesheet is bundled as well:

@import url('layout-elements/style.css');

Typings

The library includes Flow and TypeScripts type definitions. Mostly aiming at correct props usage.