ensdomains / thorin

A web3 native design system.
https://thorin.pages.dev
MIT License
78 stars 20 forks source link

ENS Design System · NPM version License

A design system for ENS built with React and styled-components.

NOTE: This project is in alpha stage. It is in active development and is subject to change.

Install

To install this package using npm:

npm install @ensdomains/thorin styled-components react-transition-state@1.1.5

To install this package using yarn:

yarn add @ensdomains/thorin styled-components react-transition-state@1.1.5

Set Up

In your App component, wrap the root of your app in a ThemeProvider module from styled-components. Import ThorinGlobalStyles and declare it as a child of ThemeProvider to set global styles. Set the theme by passing a theme object to ThemeProvider.

import { ThemeProvider } from 'styled-components'
import { ThorinGlobalStyles, lightTheme } from '@ensdomains/thorin'

const App = () => {
  return (
    <ThemeProvider theme={lightTheme}>
      <ThorinGlobalStyles />
      {children}
    </ThemeProvider>
  )
}

Dark Theme

To use the dark theme, import darkTheme and pass it to the ThemeProvider

import { ThemeProvider } from 'styled-components'
import { ThorinGlobalStyles, lightTheme } from '@ensdomains/thorin'

const App = () => {
  return (
    <ThemeProvider theme={lightTheme}>
      <ThorinGlobalStyles />
      {children}
    </ThemeProvider>
  )
}

Use Components

A list of components with examples are available on the project website.

A simple example to get you started:

import { Input, SearchSVG } from '@ensdomains/thorin'

const SearchInput = () => {
  return (
    <Input
      label="Search"
      placeholder="Name or wallet address"
      prefix={<SearchSVG />}
    />
  )
}

Documentation

You can find the full documentation on the project website.

The documentation is divided into two sections.

Development

gh clone repo @ensdomains/thorin
pnpm install
pnpm dev

Before development, it is recommended that you read the following:

Contributing

Contribute to this project by sending a pull request to this repository.

Sources

Forked from degen.