1.13.1 • Published 4 years ago

ether-ui v1.13.1

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

Ether UI

A set of Tailwind-styled React components for composing UIs.

Table of Contents

Prerequisites

  • Tailwind must be configured in your project (see Get Started).

Installation

# Using Yarn
yarn add ether-ui

# Using NPM
npm install ether-ui

Usage

Once it's installed (and Tailwind is set up!), you can start using the components right away:

import * as React from 'react';
import { Column, Grid, Heading, Text } from 'ether-ui';

const MyComponent: React.FC = () => (
  <Grid columns='12' gap='10'>
    <Column span='7'>
      <Grid gap='3'>
        <Heading level='1' size='5xl' weight='bold'>
          My Component
        </Heading>

        <Text size='lg' leading='loose'>
          Lorem, ipsum dolor sit amet consectetur adipisicing elit.
        </Text>
      </Grid>
    </Column>

    <Column span='5'>
      <Heading level='3' size='2xl'>
        Sidebar
      </Heading>
    </Column>
  </Grid>
);

export default MyComponent;

Now you've got it up and running, take a look at how the units are calculated.

Units

In the previous example, you might assume that the gap property on the <Grid /> element would space its children with 10px in between, but - because we use Tailwind's spacing - it'd actually be 40px!

Tailwind by default (see Customising Spacing) uses 4px increments for its spacing values (e.g. .m-1 and .m-3 apply 4px and 12px margin, respectively).

Components

All Components

All components share the following properties:

PropertyValueDefault
classNameReact className stringundefined
styleReact style objectundefined

Column

PropertyValueDefault
span1...12undefined
start1...13undefined
import { Column } from 'ether-ui';

<Column span='7' start='3'>
  ...
</Column>;

Container

No properties - a wrapper around the Tailwind .container class.

import { Container } from 'ether-ui';

<Container>...</Container>;

Flex

Grid

Heading

PropertyValueDefault
level1234561
sizexssmbaselgxl2xl3xl4xl5xl6xlbase
weighthairlinethinlightnormalmediumsemiboldboldextraboldblackundefined
alignleftrightcenterundefined
leadingnonetightsnugnormalrelaxedlooseundefined
trackingtightertightnormalwidewiderwidestundefined
import { Heading } from 'ether-ui';

<Heading size='3xl' weight='bold' align='center' leading='snug' tracking='wide'>
  ...
</Heading>;

Image

List

PropertyValueDefault
orderunorderedorderedunordered
modediscdecimalnonenone
gap123456810121620243240485664undefined
import { List } from 'ether-ui';

<List order='ordered' mode='decimal' gap='3'>
  ...
</List>;

ListItem

No properties - a wrapper around <li />.

import { ListItem } from 'ether-ui';

<ListItem>...</ListItem>;

Row

PropertyValueDefault
span1...6undefined
start1...7undefined
import { Row } from 'ether-ui';

<Row span='3' start='1'>
  ...
</Row>;

Scroll

No properties - an element that fills its parent and enables overflow.

import { Scroll } from 'ether-ui';

<Scroll>...</Scroll>;

Space

Text

PropertyValueDefault
sizexssmbaselgxl2xl3xl4xl5xl6xlbase
weighthairlinethinlightnormalmediumsemiboldboldextraboldblackundefined
alignleftrightcenterundefined
leadingnonetightsnugnormalrelaxedlooseundefined
trackingtightertightnormalwidewiderwidestundefined
import { Text } from 'ether-ui';

<Text size='lg' weight='semibold' align='center' leading='snug' tracking='wide'>
  ...
</Text>;

Adding to PurgeCSS

In your tailwind.config.js file, add ./node_modules/ether-ui/**/*.tsx to your purge property, e.g:

module.exports = {
  purge: {
    content: [
      './components/**/*.tsx',
      './pages/**/*.tsx',
      './node_modules/ether-ui/**/*.tsx',
    ],
  },
  theme: {},
  variants: {},
  plugins: [],
};
1.12.1

4 years ago

1.12.0

4 years ago

1.13.1

4 years ago

1.13.0

4 years ago

1.11.3

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

1.11.0

4 years ago

1.10.9

4 years ago

1.10.8

4 years ago

1.10.7

4 years ago

1.10.6

4 years ago

1.10.5

4 years ago

1.10.4

4 years ago

1.10.3

4 years ago

1.10.2

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.8.5

4 years ago

1.8.4

4 years ago

1.8.3

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.2

4 years ago

1.2.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago