GitXplorerGitXplorer
a

layout-elements

public
5 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
97d90ada91dae3fabfcf974264912ec982061cc2

remove unused files

aalexeyraspopov committed 5 years ago
Unverified
ee2aaa567ae30c7e70e95a3138bd3bc6ba6da5cc

rename the package

aalexeyraspopov committed 5 years ago
Unverified
10f4a8d91aebaf001195d94428b97f9271527f91

implement scene component with aspect ratio support

aalexeyraspopov committed 5 years ago
Unverified
4cfa5ca591846f566531ebeb2eb5d5bbc67fb2a1

explicitly define no side effects

aalexeyraspopov committed 5 years ago
Unverified
26537d5d5fc76f6e61457579701c711996784daa

use prettier

aalexeyraspopov committed 5 years ago
Unverified
6071f339ebeea6cbbf7cd4473a2d9939815f420d

use multi entry build

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.