Can I use this library with shadcn/ui? #2140
-
Can I use this library with shadcn/ui? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
As far as I know there's no problem. You can use some components from daisyUI and some other components from other libraries. Let me know if you have any questions. |
Beta Was this translation helpful? Give feedback.
-
If you want to use DaisyUI's color themes in ShadcnUI, you can try the following methods:
const daisyuiColorObj = require('daisyui/src/theming/index')
...
theme: {
...
extend: {
colors: {
border: daisyuiColorObj['base-content'],
input: daisyuiColorObj['base-content'],
ring: daisyuiColorObj['base-content'],
background: daisyuiColorObj['base-100'],
foreground: daisyuiColorObj['base-content'],
primary: {
DEFAULT: daisyuiColorObj['primary'],
foreground: daisyuiColorObj['primary-content'],
},
secondary: {
DEFAULT: daisyuiColorObj['secondary'],
foreground: daisyuiColorObj['secondary-content'],
},
destructive: {
DEFAULT: daisyuiColorObj['error'],
foreground: daisyuiColorObj['error-content'],
},
muted: {
DEFAULT: daisyuiColorObj['base-300'],
foreground: daisyuiColorObj['base-content'],
},
accent: {
DEFAULT: daisyuiColorObj['accent'],
foreground: daisyuiColorObj['accent-content'],
},
popover: {
DEFAULT: daisyuiColorObj['base-100'],
foreground: daisyuiColorObj['base-content'],
},
card: {
DEFAULT: daisyuiColorObj['base-100'],
foreground: daisyuiColorObj['base-content'],
},
},
borderRadius: {
lg: 'var(--rounded-btn)',
md: 'calc(var(--rounded-btn) - 2px)',
sm: 'calc(var(--rounded-btn) - 4px)',
},
keyframes: {
'accordion-down': {
from: { height: '0' },
to: { height: 'var(--radix-accordion-content-height)' },
},
'accordion-up': {
from: { height: 'var(--radix-accordion-content-height)' },
to: { height: '0' },
},
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out',
},
}, |
Beta Was this translation helpful? Give feedback.
-
Hey, I would like to use shadcn components but using the themes and style from daisyUI, any one could make is work? |
Beta Was this translation helpful? Give feedback.
As far as I know there's no problem.
You can use some components from daisyUI and some other components from other libraries.
In case there's conflict with class names (both libraries apply styles to the same class name) you can use the
prefix
config of daisyUI to add a specific prefix to all daisyUI class names and avoid style conflicts.Let me know if you have any questions.