1.2.27 • Published 2 years ago

@tlon/indigo-react v1.2.27

Weekly downloads
32
License
MIT
Repository
-
Last release
2 years ago

indigo-react

npm (scoped)

Indigo React is a component library for implementing the Indigo Design System. It's built with React, styled-components and styled-system. It also uses Formik and Reach-UI.

Warning: This library is being deprecated.

Quick Start

  1. Install the library
npm install --save @tlon/indigo-react
  1. Install peer dependencies
npm install --save @tlon/indigo-light styled-components styled-system react react-dom @reach/disclosure @reach/menu-button @reach/tabs markdown-to-jsx formik

If you are using Typescript, install the type definitions for several of these libraries.

npm install --save @types/styled-components @types/styled-system @types/styled-system__css
  1. Install a theme
npm install --save @tlon/indigo-light @tlon/indigo-dark

Basic Usage

import * as React from "react";
import { ThemeProvider } from "styled-system";
import { Text, Reset } from "@tlon/indigo-react";
import light from "@tlon/indigo-light";

class App extends React.Component {
  render() {
    return (
      <ThemeProvider theme={light}>
        <Reset />
        <Text fontSize="2">Indigo!</Text>
      </ThemeProvider>
    );
  }
}

In the above, we are wrapping our application in styled-component's ThemeProvider and passing in our theme from @tlon/indigo-light. In practice, you should rarely need to import the theme.

The <Text /> component accepts a fontSize prop, which is one of many style props provided by styled-system. Using VSCode is the best way to see the list of props each component can accept.

You can also check out the styled-system docs for a breakdown of props.

Many of these props have corrosponding styling shortcuts, drawn from the provided theme, like @tlon/indigo-light. These shortcuts are also provided by styled-system. To see how props map to values in our theme, check out styled-system's mapping.

Take a look at the theme to get a sense for which style values can be accessed from styled props.

Development

See DEVELOPMENT.md for example cases of component patterns used to create Indigo.

Related

LibraryGithubNPM
indigo-lighthttps://www.github.com/urbit/indigo-lighthttps://www.npmjs.com/package/@tlon/indigo-light
indigo-darkhttps://www.github.com/urbit/indigo-darkhttps://www.npmjs.com/package/@tlon/indigo-dark
indigo-reacthttps://www.github.com/urbit/indigo-reacthttps://www.npmjs.com/package/@tlon/indigo-react

License

MIT License © Tlon

1.2.27

2 years ago

1.2.26

2 years ago

1.2.25

3 years ago

1.2.23

3 years ago

1.2.24

3 years ago

1.2.21

3 years ago

1.2.22

3 years ago

1.2.20

3 years ago

1.2.19

3 years ago

1.2.18

3 years ago

1.2.17

3 years ago

1.2.16

3 years ago

1.2.15

3 years ago

1.2.14

3 years ago

1.2.13

4 years ago

1.2.12

4 years ago

1.2.11

4 years ago

1.2.9

4 years ago

1.2.10

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.9

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago