npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

chaya-ui

v1.0.0-beta.87

Published

Modern, Functional Design System & Components for React

Downloads

273

Readme

Chaya features a collection of reusable components, and other frontend utility functions for React, that are used to design a consistent, modern and accessible frontend for Traboda platforms. Chaya makes it seamless to build a consistent and accessible frontend for your platforms made with React.

  • 40+ UI components, 4+ hooks, and even more to come
  • Built with TypeScript, fully typed
  • Styled with Tailwind CSS (v3)
  • Supports Dark Mode & Custom Theming

Looking to Explore?

Checkout examples from our Storybook: chaya.traboda.com

Installing Chaya

  1. Install the package by running -
npm install chaya-ui

or with yarn, as

yarn add chaya-ui

Setting Up & Usage

To start using the components, please follow the below steps:

  1. Wrap your Application in a DSRContextProvider provided by chaya-ui

    import { ReactNode } from "react";
    
    // external libraries for example usecase
    import Link from 'next/link';
    import { Search, X } from 'react-feather';
    
    import { DSRContextProvider } from 'chaya-ui';
    
    const AppView = ({ children }: { children: ReactNode }) => (
      <DSRContextProvider
        linkWrapper={(link: string, component: ReactElement) => <Link href={link}>{component}</Link>}
        theme={{
          primary: '#019e4b',
          secondary: '#019e4b',
          background: '#fff',
          color: '#333'
        }}
        iconWrapper={(icon, props) => ({
          search: <Search {...props} />,
          times: <X {...props} />,
          // ...
        })[icon] ?? <>n/a</>}
      >
        {children}
      </DSRContextProvider>
    );
    • linkWrapper lets you wrap links with a custom component, for example, next/link or react-router-dom/Link so that the links are handled by the router of your choice.
    • theme lets you define the primary, secondary, background and color colors for the theme. These colors are used to generate the CSS variables for the theme.
    • iconWrapper lets you wrap icons with a custom component, for example, react-feather or react-icons so that the icons are rendered by the icon library of your choice.
  2. Update your tailwind.config.js to process styles for components from chaya-ui

    const theme = require('chaya-ui/tailwind-theme');
       
    /** @type {import('tailwindcss').Config} */
    module.exports = {
     content: [
         'node_modules/chaya-ui/**/*.js',
         // ...
     ],
     // ...
     theme: {
         extend: theme,
     },
     // ...
    };
  3. Import the components from chaya-ui and use them in your application.

    import { Button } from 'chaya-ui';
    
    const App = () => (
      <Button 
        onClick={() => console.log('I was clicked')} 
        variant="outline" 
        color="danger"
      >
          Click Me
      </Button>
    );

Development Guide

We use npm as the package manager

npm run dev

This will start the storybook and loads the stories from ./stories at localhost:6006.

The package can be build using the command:

npm run build

Type checks and linting commands are also available in the package

npm run lint
npm run type-check

Credits

Contributions

Contributions are welcome. Please open an issue or a PR.

Licensing

This project is licensed under the GNU General Public License V3.

Made by Traboda with ❤️ in India 🇮🇳.