Skip to content

imevro/react-ui-atoms-css-modules

Repository files navigation

React UI Atoms

Atomic components for React UI styled with CSS Modules

build status

Table Of Contents

Usage

npm install --save @react-ui/core@latest @react-ui/atoms-css-modules

Supply components and their styles to initUI:

// src/components/ui/index.js

import initUI from '@react-ui/core';
import atoms from '@react-ui/atoms-css-modules';

import Header from 'src/components/ui/header';

const UI = initUI(atoms.components, { Header })(atoms.styles);

export default UI;

Use atomic components where needed:

import React, { Component } from 'react';

import UI from 'src/components/ui';
const {
  Button, Label,
  Grid: { Container, Row, Col },
} = UI;

class MyUberComponent extends Component {
  render() {
    return (
      <Container>
        <Row>
          <Col>
            <Header>Beautiful Header</Header>
          </Col>
        </Row>
        <Row>
          <Col>
            <Label>Here I am!</Label>
            <Button kind="primary">Press me</Button>
          </Col>
        </Row>
      </Container>
    );
  }
}

Components List

License

Apache License, Version 2.0

About

Atomic components for React UI styled with CSS Modules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published