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

react-daisyui

v5.0.5

Published

react-daisyui - DaisyUI components built with React ๐ŸŒผ

Downloads

40,080

Readme

daisyUI components built with React, Typescript and TailwindCSS

[ See all components ]

card-3

react-daisyui ๐ŸŒผ

NPM Version npm bundle size npm License Discord Invite

๐Ÿ“– Check out our Storybook | ๐ŸŽฒ Try it with CodeSandbox

๐Ÿ™‹ Need help or have a suggestion? Join our discord!


๐Ÿ’ฟ Install

Make sure you've installed TailwindCSS and daisyUI.

Install the package with npm or yarn:

npm install react-daisyui
or
yarn add react-daisyui

To prevent TailwindCSS from purging your styles, add the following line to your tailwind.config.js:

module.exports = {
  content: [
    'node_modules/daisyui/dist/**/*.js',
    'node_modules/react-daisyui/dist/**/*.js',
  ],
  plugins: [require('daisyui')],
}

Modify transpilePackages in your next.config.js file:

const nextConfig = {
  // ... your content here
  transpilePackages: ['react-daisyui'],
  reactStrictMode: true,
}

module.exports = nextConfig
npm install next-transpile-modules

And import the package inside your next.config.js file:

const withTM = require('next-transpile-modules')(['react-daisyui'])

Finally, you can wrap your module.exports using withTM like so:

module.exports = withTM({
  //... your content here
  reactStrictMode: true,
})

โšก Quick Start

Import react-daisyui components within your component files:

import { Button } from 'react-daisyui'

export default (props) => {
  return <Button color="primary">Click me!</Button>
}

๐ŸŽจ Themes

To apply a theme (or multiple themes) to a page or components, import the Theme component and wrap your content:

import { Theme, Button } from 'react-daisyui'

export default (props) => {
  return (
    <>
      <Theme dataTheme="dark">
        <Button color="primary">Click me, dark!</Button>
      </Theme>

      <Theme dataTheme="light">
        <Button color="primary">Click me, light!</Button>
      </Theme>
    </>
  )
}

Use tools like the official daisyUI Theme Generator or daisyUI Theme Builder to easily create your own themes.


โš™๏ธ Components

  • [x] Button
  • [X] Dropdown
  • [X] Modal
  • [X] Swap
  • [ ] Theme Controller
  • [x] Accordion
  • [X] Avatar
  • [X] Badge
  • [X] Card
  • [X] Carousel
  • [X] Chart Bubble
  • [X] Collapse
  • [X] Countdown
  • [X] Diff
  • [X] Kbd
  • [X] Stats
  • [X] Table
  • [X] Timeline
  • [x] Bottom Navigation
  • [x] Breadcrumbs
  • [x] Link
  • [x] Menu
  • [x] Navbar
  • [x] Pagination
  • [x] Steps
  • [x] Tabs
  • [x] Alert
  • [X] Loading
  • [X] Progress
  • [X] Radial Progress
  • [ ] Skeleton
  • [x] Toast
  • [X] Tooltip
  • [x] Checkbox
  • [x] FileInput
  • [x] Input
  • [x] Radio
  • [x] Range
  • [x] Rating
  • [x] Select
  • [x] Textarea
  • [x] Toggle
  • [x] Artboard
  • [x] Button Group (Deprecated)
  • [x] Divider
  • [x] Drawer
  • [x] Footer
  • [x] Hero
  • [x] Indicator
  • [x] Input Group (Deprecated)
  • [x] Join (group items)
  • [x] Mask
  • [x] Stack
  • [x] Browser
  • [x] Code
  • [x] Phone
  • [x] Window

๐Ÿค Contributing

We're looking for contributors to help write stories and unit tests for components.

Creating new components

Run npm run generate component ${your_new_component_name}. The generator will ask a few questions and setup the component for you.

When you'e done, export the component from index.tsx and open a PR.

Creating new stories

Check out the official daisyUI examples. ๐Ÿ‘ˆ


License

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