0.0.23 • Published 27 days ago

@savantly/nexus-ui-components v0.0.23

Weekly downloads
-
License
-
Repository
-
Last release
27 days ago

Nexus UI Components

This is a component library for React + Tailwind

Storybook -
https://nexus-ui-components.vercel.app/

It provides a simple way to bootstrap app development by leveraging Tailwind and TW Classed.

Read more about TW-Classed here -
https://github.com/sannajammeh/tw-classed

Read more about Tailwind here -
https://tailwindcss.com/

Quick start

Install the library

npm install --save @savantly/nexus-ui-components

Import the default css variable file in your layout/index (or copy/edit your own) -

import '@savantly/nexus-ui-components/dist/themes/nexus.css';

Import the color mapping in your Tailwind config -

/** @type {import('tailwindcss').Config} */
import { nexusThemeConfig } from "@savantly/nexus-ui-components";

export default {
  content: [
    "./index.html",
    "./src/**/*.{js,ts,jsx,tsx}",
    'node_modules/@savantly/nexus-ui-components/dist/**/*.js',
  ],
  theme: {
    extend: {
      colors: nexusThemeConfig.colors, // Add the color mapping
    },
  },
};

Import a component and use it -

import { Button } from '@savantly/nexus-ui-components';

export const Page = () => {
    return (
        <Button>Test Button</Button>
    )
};

Why?

Why another UI component library? Don't we have a zillion already?

Yes we do =(
But it seems I'm always looking for another one, because of various reasons.

  • license issues
  • flakey integrations
  • complicated customizations
  • lacking features

This library uses CSS vars to add custom colors to extend Tailwind, and the components leverage the built-in and generated classes to give a theming experience similar to Bootstrap.

It's compatible with Next JS app routing, and it's easy to create a custom theme, or extend with existing Tailwind classes.

The TW Classed project provides an excellent developer experience to create custom components with Tailwind.
The properties are typed, and the "variants" system allows us to create self-explanatory components.

React + TypeScript + Vite + Tailwind + Storybook

All the UI components should be small and reusable.
See ./lib/components/ for examples.

The ./src/App.tsx can be used as a demo area for the components, but the React app is NOT published.
This project uses the Vite Library configuration to rollup a UI lib for consumption in other web applications.

Custom Theme

You can create a custom theme by copying the theme file and updating the color values.

./src/themes/nexus.css

Contributing

To develop the components, install the dependencies and run the Storybook for realtime dev iteration.

pnpm install
pnpm run storybook

To add styles, use the Tailwind class names.
If you must use custom styles, use CSS modules in the component's folder.

0.0.23

27 days ago

0.0.21

28 days ago

0.0.22

28 days ago

0.0.20

29 days ago

0.0.15

29 days ago

0.0.16

29 days ago

0.0.17

29 days ago

0.0.18

29 days ago

0.0.19

29 days ago

0.0.13

1 month ago

0.0.14

30 days ago

0.0.12

2 months ago

0.0.10

2 months ago

0.0.11

2 months ago

0.0.9

2 months ago

0.0.8

2 months ago

0.0.7

2 months ago

0.0.6

2 months ago

0.0.5

2 months ago

0.0.4

2 months ago

0.0.3

2 months ago

0.0.1

2 months ago