Skip to content
SaisinarePublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DustUI

A modern, lightweight React component library built with TypeScript and styled with Tailwind CSS.

npm version License

Features

  • Modern Stack: Built with React 19, TypeScript, and Tailwind CSS
  • Tree Shakeable: Only import what you need
  • TypeScript First: Full TypeScript support with exported types
  • Customizable: Easy to style and extend
  • Storybook: Interactive component documentation
  • Lightweight: Minimal bundle size
  • Developer Friendly: Simple API and great DX

Installation

npm install dustui
# or
yarn add dustui
# or
pnpm add dustui

Quick Start

import { Button, Card } from 'dustui';
import 'dustui/styles.css';

function App() {
  return (
    <div>
      <Card title="Welcome to DustUI">
        <p>A modern React component library</p>
      </Card>
      
      <Button variant="primary" onClick={() => alert('Clicked!')}>
        Click Me
      </Button>
    </div>
  );
}

Components

Button

A versatile button component with multiple variants and sizes.

import { Button } from 'dustui';

// Variants
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="outline">Outline</Button>
<Button variant="danger">Danger</Button>

// Sizes
<Button size="small">Small</Button>
<Button size="medium">Medium</Button>
<Button size="large">Large</Button>

// States
<Button disabled>Disabled</Button>

// Custom handler
<Button onClick={() => console.log('clicked')}>
  Click Me
</Button>

Button Props

Prop Type Default Description
children ReactNode - Button content (required)
variant 'primary' | 'secondary' | 'outline' | 'danger' 'primary' Button style variant
size 'small' | 'medium' | 'large' 'medium' Button size
disabled boolean false Disable the button
onClick () => void - Click handler
type 'button' | 'submit' | 'reset' 'button' Button type
className string '' Additional CSS classes

Card

A flexible card component for displaying content.

import { Card } from 'dustui';

// Basic card
<Card title="Card Title">
  <p>Card content goes here</p>
</Card>

// With description
<Card 
  title="Card Title" 
  description="Card description"
>
  <p>Card content</p>
</Card>

// Clickable card
<Card 
  title="Clickable Card"
  onClick={() => console.log('Card clicked')}
>
  <p>Click anywhere on this card</p>
</Card>

// Custom styling
<Card 
  title="Custom Card"
  className="my-custom-class"
>
  <p>Styled card content</p>
</Card>

Card Props

Prop Type Default Description
children ReactNode - Card content (required)
title string - Card title (optional)
description string - Card description (optional)
onClick () => void - Click handler for the card
className string '' Additional CSS classes

Styling

DustUI uses Tailwind CSS for styling. Make sure to import the styles in your application:

import 'dustui/styles.css';

Custom Styling

You can override styles by:

  1. Using className prop:
<Button className="my-custom-button">Custom Button</Button>
  1. Using CSS/Tailwind classes:
.my-custom-button {
  /* Your custom styles */
}

Development

Prerequisites

  • Node.js >= 18
  • npm/yarn/pnpm

Setup

# Clone the repository
git clone https://github.com/Saisinare/dustui.git
cd dustui

# Install dependencies
npm install

# Start Storybook
npm run storybook

# Build the library
npm run build

# Run tests
npm run test

Scripts

  • npm run dev - Start development server
  • npm run build - Build the library
  • npm run storybook - Start Storybook
  • npm run build-storybook - Build Storybook
  • npm run lint - Lint the code
  • npm run test - Run tests

Documentation

Visit our Storybook for interactive component documentation and examples.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Saisinare

Acknowledgments


Made with ❤️ by Saisinare

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages