
daisyUI Usage
SkilldaisyUI 5 的用法规则:用组件、部件与修饰类名组合样式,类名不够时再补 Tailwind 工具类,实在覆盖不了才用 ! 强制;未指定时用默认变体,布局加响应式前缀,设计决策参考《Refactoring UI》。daisyUI 官方技能的子指南。
name: daisyui-usage
description: Usage rules that you must use with daisyUI 5
daisyUI 5 usage rules
- To style an HTML element, add daisyUI class names to it. Add the necessary component class name. Also add the applicable part and modifier class names.
- If the current daisyUI classes cannot make a necessary change, use Tailwind CSS utility classes. For example,
btn px-10sets custom horizontal padding on abtn. - If CSS specificity prevents a change to a daisyUI style, add
!to the end of the Tailwind utility. For example,btn bg-red-500!overrides the background color of abtn. Use this method only if other methods do not work. Do not use it frequently. - If daisyUI does not have an applicable component, make a component with Tailwind CSS utilities.
- When you use Tailwind CSS
flexorgridfor a layout, add responsive utility prefixes. - Use only current daisyUI class names or Tailwind CSS utility classes.
- If custom CSS is not necessary, do not write it. If possible, use daisyUI class names or Tailwind CSS utility classes.
- If you need placeholder images, use https://picsum.photos/200/300 with the necessary dimensions.
- If a custom font is not necessary, do not add one.
- If
bg-base-100 text-base-contentis not necessary, do not add it to the body. - For design decisions, use the methods in the Refactoring UI book.
- If the user does not request a variant or color, use the default variant. For example, use
btnfor a button. If the user does not request that variant, do not usebtn btn-primary.
Each daisyUI 5 class name is in one of these categories. These category names are for reference only. Do not use them in code.
component: The necessary component class.part: A child part of a component.style: Sets a specified style on a component or part.behavior: Changes the behavior of a component or part.color: Sets a specified color on a component or part.size: Sets a specified size on a component or part.placement: Sets a specified position for a component or part.direction: Sets a specified direction for a component or part.modifier: Changes the component or part in a specified way.variant: A prefix for a utility class that applies styles in specified conditions. The syntax isvariant:utility-class.
Change a component in CSS
Use the Tailwind @utility directive to change a daisyUI component globally:
@utility btn {
@apply rounded-full;
}
daisyUI utilities and variables
- You can use semantic colors with Tailwind color utilities and opacity modifiers. Examples are
bg-primary,border-base-300, andtext-base-content/60. rounded-box,rounded-field, androunded-selectoruse the radius tokens of the active theme.glassapplies the daisyUI glass effect.- Some components supply CSS variables for component-specific changes. Countdown uses
--valueand--digits. Radial progress uses--sizeand--thickness.
Base modules
daisyUI includes the properties, rootcolor, scrollbar, rootscrolllock, rootscrollgutter, and svg base modules. To exclude a module from the plugin configuration, use its module name:
@plugin "daisyui" {
exclude: rootscrollgutter;
}
Use include or exclude for library modules. For visual changes, use Tailwind utilities or @utility.
相關資源

daisyUI
SkilldaisyUI 官方技能,让 agent 编写 HTML 或 JSX 时使用 daisyUI 5 的组件类名、语义色与主题:先按功能挑选合适的组件并阅读对应文档,再按其结构与约束写代码,附带安装、用法、配置与颜色等子指南。基于 Tailwind CSS 4。
saadeghi/daisyui42.7k
Web Artifacts Builder
Skill用 React、Tailwind CSS 与 shadcn/ui 搭建需要状态管理或路由的多组件网页,自带初始化与打包脚本,最终打包成单个 HTML 文件作为 claude.ai Artifact。Anthropic 官方技能。
anthropics/skills188k
shadcn/ui
Skillshadcn/ui 官方技能:让 agent 借助 shadcn CLI 读取项目配置与组件文档,按规范添加、搜索、组合和修复组件,遵守样式、表单与无障碍规则,也能用预设初始化新项目。
shadcn-ui/ui127k
daisyUI Config
SkilldaisyUI 5 的配置说明:在 CSS 的 daisyUI 插件块中设置启用哪些主题、默认主题与深色模式主题、根选择器、包含或排除的模块、类名前缀和控制台日志,并附完整示例。daisyUI 官方技能的子指南。
saadeghi/daisyui42.8k
daisyUI Colors
SkilldaisyUI 5 的颜色规则:说明 primary、base-100、error 等语义色及其 -content 前景色的用途,要求尽量只用语义色、不给它们加 dark: 前缀,并给出启用内置主题、编写自定义主题和修改已有主题的写法。daisyUI 官方技能的子指南。
saadeghi/daisyui42.7k
daisyUI Install
SkilldaisyUI 5 的安装说明:必须搭配 Tailwind CSS 4、不再使用 tailwind.config.js,用 npm 安装后在 CSS 中引入插件;也给出 CDN 引入方式,以及 Next.js、Vue、SvelteKit、Laravel 等框架安装指南的链接。daisyUI 官方技能的子指南。
saadeghi/daisyui42.7k