2.12.0 • Published 6 days ago

nayan v2.12.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 days ago

Nayan UI provides React Reusable Components based on Tailwind CSS and Radix UI. This library is a collection of pre-designed and pre-built React components that can be used to quickly and easily build beautiful, functional and fully accessible user interfaces for your web applications.

NPM version Follow Twitter

🖥 Demo

Checkout demo for all the components Nayan UI exposing Checkout

✨ Features

  • 🌈 Enterprise-class UI designed for web applications.
  • 📦 A set of high-quality React components out of the box.
  • 🛡 Written in TypeScript with predictable static types.
  • ⚙️ Whole package of design resources and development tools.
  • 🌍 Internationalization support for dozens of languages.
  • 🎨 Powerful theme customization based on Tailwind CSS.

🖥 Environment Support

🔨 Install

npm install nayan
yarn add nayan

Include module in tailwind.config.js to read tailwind classes, this will help in reusing same tailwind classes.

module.exports = {
  important: true,
  darkMode: ['class'],
  content: ['./src/**/*.{ts,tsx}', './index.html', './node_modules/nayan/dist/index.es.js'], // Check node_modules path properly
  theme: {
    extend: {
      colors: {
        primary: 'var(--COLOR_PRIMARY)',
        'primary-light': 'var(--COLOR_PRIMARY_LIGHT)',
        'primary-dark': 'var(--COLOR_PRIMARY_DARK)',
        background: 'var(--COLOR_BACKGROUND)',
        text: 'var(--COLOR_TEXT)',
        muted: 'var(--COLOR_MUTED)',
        border: 'var(--COLOR_BORDER)',
        card: 'var(--COLOR_CARD)',
        shadow: 'var(--COLOR_SHADOW)',
        overlay: 'var(--COLOR_OVERLAY)'
      }
    }
  },
  plugins: [require('tailwindcss-animate')]
};

Add library styles to index.css, and update theme color variables accordingly for both light and dark modes.

@import 'node_modules/nayan/dist/styles.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --COLOR_PRIMARY: #005ee6;
    --COLOR_PRIMARY_DARK: #0043a3;
    --COLOR_PRIMARY_LIGHT: #0069ff;
    --COLOR_BACKGROUND: #f5f5f5;
    --COLOR_CARD: #ffffff;
    --COLOR_TEXT: #050505;
    --COLOR_MUTED: gray;
    --COLOR_BORDER: #d3d3d3;
    --COLOR_SHADOW: #d3d3d3;
    --COLOR_OVERLAY: rgba(255, 255, 255, 0.7);
  }

  [data-theme='dark'] {
    --COLOR_PRIMARY: #005ee6;
    --COLOR_PRIMARY_DARK: #0043a3;
    --COLOR_PRIMARY_LIGHT: #0069ff;
    --COLOR_BACKGROUND: #1f1f1f;
    --COLOR_CARD: #303030;
    --COLOR_TEXT: #f5f5f5;
    --COLOR_MUTED: gray;
    --COLOR_BORDER: #505050;
    --COLOR_SHADOW: #cbcbcb;
    --COLOR_OVERLAY: rgba(0, 0, 0, 0.7);
  }

  body {
    color: var(--COLOR_TEXT) !important;
    background-color: var(--COLOR_BACKGROUND) !important;
  }
}

🕹 Usage

Theme

import { useState } from 'react';
import { NTheme, THEMES, useLocalStorage } from 'nayan';

const App = () => {
  const [theme, setTheme] = useLocalStorage('THEME', THEMES.LIGHT);

  const toggleTheme = () => {
    setTheme(theme === THEMES.LIGHT ? THEMES.DARK : THEMES.LIGHT);
  };

  return (
    <NTheme theme={theme}>
      <div className="p-3" onClick={toggleTheme}>
        TOGGLE THEME
      </div>
    </NTheme>
  );
};

export default App;

For more info checkout example source code from Github and run it in local.

⌨️ Development

Nayan project is included with all possible cases with examples, it can be ran locally to test each component.

$ git clone git@github.com:ursnj/nayan.git
$ cd nayan
$ npm install
$ npm start

Open your browser and visit http://localhost:7100

🤝 Contributing PRs Welcome

We welcome all contributions. You can submit any ideas as Pull Requests or as GitHub Issues. If you'd like to improve code, check out the Development Instructions and have a good time! :)

comment: <> (# Deployment)

comment: <> (docker build -t ursnj/nayanui:latest .)

comment: <> (docker push ursnj/nayanui:latest)

comment: <> (docker run -d -p 7100:7100 ursnj/nayanui)

2.12.0

6 days ago

2.11.0

1 month ago

2.10.0

3 months ago

2.9.0

3 months ago

2.2.0

7 months ago

2.4.0

7 months ago

2.6.0

7 months ago

2.8.0

7 months ago

2.3.0

7 months ago

2.5.0

7 months ago

2.7.0

7 months ago

2.0.0

8 months ago

2.1.0

8 months ago

1.4.4

11 months ago

1.4.3

11 months ago

1.4.2

11 months ago

1.4.1

11 months ago

1.4.0

11 months ago

1.5.1

10 months ago

1.5.0

10 months ago

1.3.0

11 months ago

2.0.0-beta-9

9 months ago

2.0.0-beta-8

9 months ago

2.0.0-beta-7

9 months ago

2.0.0-beta-6

9 months ago

2.0.0-beta-12

9 months ago

2.0.0-beta-10

9 months ago

2.0.0-beta-16

9 months ago

2.0.0-beta-1

10 months ago

2.0.0-beta-15

9 months ago

2.0.0-beta-14

9 months ago

2.0.0-beta-13

9 months ago

2.0.0-beta-5

9 months ago

2.0.0-beta-4

9 months ago

2.0.0-beta-18

9 months ago

2.0.0-beta-3

10 months ago

2.0.0-beta-17

9 months ago

2.0.0-beta-2

10 months ago

1.2.0

12 months ago

1.1.0

12 months ago

1.0.0

1 year ago

1.0.0-beta-5

1 year ago

1.0.0-beta-4

1 year ago

1.0.0-beta-3

1 year ago

1.0.0-beta-2

1 year ago

1.0.0-beta-1

1 year ago

1.0.0-alpha-19

1 year ago

1.0.0-alpha-18

1 year ago

1.0.0-alpha-17

1 year ago

1.0.0-alpha-16

1 year ago

1.0.0-alpha-15

1 year ago

1.0.0-alpha-14

1 year ago

1.0.0-alpha-13

1 year ago

1.0.0-alpha-12

1 year ago

1.0.0-alpha-11

1 year ago

1.0.0-alpha-10

1 year ago

1.0.0-alpha-9

1 year ago

1.0.0-alpha-8

1 year ago

1.0.0-alpha-7

1 year ago

1.0.0-alpha-6

1 year ago

1.0.0-alpha-5

1 year ago

1.0.0-alpha-4

1 year ago

1.0.0-alpha-3

1 year ago

1.0.0-alpha-2

1 year ago

1.0.0-alpha-1

1 year ago