GitHub

Eggspot Design System

Like every projects at Eggspot, this is a collaborated work between designers and engineers.

Introduction

Getting started

Welcome to Eggspot Design System (DS).

Dango allows you to make beautiful, modern, and fast websites/applications regardless of your design experience, created with React.js and Stitches, based on React Aria and inspired by NextUI.


Installation

Inside your React project directory, install NextUI by running either of the following:

yarn add @eggspot/ui
# or
npm install @eggspot/ui

Next.js

  1. Go to pages/_app.tsx (create it if it doesn't exist) and add this:
// _app.tsx
import { ThemeUIProvider } from '@eggspot/ui';

function MyApp({ Component, pageProps }) {
  return (
    // 2. Use at the root of your app
    <ThemeUIProvider>
      <Component {...pageProps} />
    </ThemeUIProvider>
  );
}

export default MyApp;
  1. Go to pages/_document.tsx (create if it doesn't exist) and add this:
//_document.tsx
import React from 'react';
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { CssBaseline } from '@eggspot/ui';

class MyDocument extends Document {
  static async getInitialProps(ctx) {
    const initialProps = await Document.getInitialProps(ctx);
    return {
      ...initialProps,
      styles: React.Children.toArray([initialProps.styles])
    };
  }

  render() {
    return (
      <Html lang="en">
        <Head>{CssBaseline.flush()}</Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </Html>
    );
  }
}

export default MyDocument;

Using components

import { Button } from '@eggspot/ui';

const Component = () => <Button>Click me</Button>;

ThemeUIProvider Props

AttributeTypeAccepted valuesDescriptionDefault
themeUIThemesThemeObjectOptional custom themedark
disableBaselinebooleantrue/falseIncludes <CssBaseline/>false

Typescript types

Theme object

For more information you can see the Stitches theme documention

{
  "type": "dark", // light / dark
  "className": "", // optional
  "theme": {
    "colors": {},
    "space": {},
    "fontSizes": {},
    "fonts": {},
    "fontWeights": {},
    "lineHeights": {},
    "letterSpacings": {},
    "sizes": {},
    "borderWidths": {},
    "borderStyles": {},
    "radii": {},
    "shadows": {},
    "zIndices": {},
    "transitions": {}
  }
}