5.0.0 ā€¢ Published 5 months ago

react-daisyui v5.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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

  • Bottom Navigation
  • Breadcrumbs
  • Link
  • Menu
  • Navbar
  • Pagination
  • Steps
  • Tabs
  • Checkbox
  • FileInput
  • Input
  • Radio
  • Range
  • Rating
  • Select
  • Textarea
  • Toggle
  • Artboard
  • Button Group (Deprecated)
  • Divider
  • Drawer
  • Footer
  • Hero
  • Indicator
  • Input Group (Deprecated)
  • Join (group items)
  • Mask
  • Stack
  • Browser
  • Code
  • Phone
  • 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.

5.0.0

5 months ago

4.1.2

7 months ago

4.1.1

8 months ago

4.0.4

9 months ago

4.0.1

10 months ago

4.0.0

11 months ago

4.0.3

9 months ago

4.0.2

9 months ago

4.1.0

9 months ago

3.0.3

1 year ago

3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

2.4.3

2 years ago

2.4.5

2 years ago

2.4.4

2 years ago

3.0.2

1 year ago

3.0.1

1 year ago

2.5.0

1 year ago

2.4.7

1 year ago

2.4.6

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.4.2

2 years ago

2.3.0

2 years ago

2.0.3

2 years ago

2.2.0

2 years ago

2.0.2

2 years ago

2.3.2

2 years ago

2.0.5

2 years ago

2.3.1

2 years ago

2.0.4

2 years ago

2.0.6

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

1.2.0

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.7.3

2 years ago

1.7.2

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.1

2 years ago

1.5.1

2 years ago

1.4.0

2 years ago

1.2.2

2 years ago

1.0.4

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

2.0.0

2 years ago

1.7.6

2 years ago

1.7.5

2 years ago

1.7.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.3

2 years ago

0.3.0

2 years ago

0.0.2

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago