pick-ui-library
它能做什么
这个技能告诉你在常见任务中应使用哪个前端库。适合希望获得一个明确推荐、而不是比较大量选项的开发者。
适用场景
- ✓当你需要用于消息提示、图表或拖放等前端任务的库时。
- ✓当你想确认你的项目是否已经在使用合适的库时。
- ✓当你希望得到一个明确推荐,而不是一长串选项时。
技能链接
https://github.com/spree/spree/blob/main/.agents/skills/pick-ui-library/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 React 应用需要消息通知。我应该使用哪个库?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会确定真正的任务,检查项目的包文件,看看已经安装了什么,然后从其列表中推荐一个库,并附上一句理由。如果任务不在列表中,它会在给出建议之前说明这一点。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Picking The Right Library
A lookup skill. When invoked with a task ("I need toasts", "what should I use for drag and drop?"), match the task to the curated list below and recommend the library. These are deliberate, taste-driven picks — don't substitute alternatives outside this list unless the user asks for one or the task genuinely isn't covered.
How to use this
- Identify the task, not the library the user named. "I need to show a dropdown" is a UI-primitives task (base-ui), even if they asked about something else.
- Check what's already installed. Look at
package.jsonfirst. If the project already uses a listed library, use it. If it uses a competitor (e.g. react-window instead of Virtuoso), flag the recommendation but don't churn the dependency without being asked. - Recommend one library, state what it's for in one sentence, and install/wire it up if that's part of the request. Don't present a menu of options when the list has a clear answer.
- If the task isn't covered by the list, say so explicitly and recommend from your own knowledge — but be clear you've left the curated list.
The list
UI components & primitives
| Task | Library |
|---|---|
| Unstyled, accessible UI components (dialogs, popovers, menus, selects…) | base-ui |
| Command menus (⌘K palettes) | cmdk |
| Toasts / notifications | Sonner |
| One-time password / verification code inputs | input-otp |
| Customizable GUIs / control panels | Leva — dialkit is an alternative |
Motion & visuals
| Task | Library |
|---|---|
| General-purpose animation (springs, layout animations, enter/exit) | motion (Framer Motion) |
| Animating numbers (counters, prices, stats) | NumberFlow |
| Animated text components | torph |
| 3D globes | Cobe |
| Dynamic OG images (HTML/CSS → SVG/PNG) | Satori |
| Syntax highlighting | shiki |
Reach for motion when you need springs, layout animations, exit animations, or gesture-driven values. A simple hover or fade doesn't need it — plain CSS transitions are the right tool there.
Charts
| Task | Library |
|---|---|
| Real-time / streaming charts | Liveline |
| General charts (static or interactive dashboards) | recharts |
The split: if data points arrive live and the chart scrolls with time, use Liveline. Everything else is recharts.
Interaction & performance
| Task | Library |
|---|---|
| Drag and drop | dnd kit |
| Virtualization (long lists, large tables) | Virtuoso |
State & styling
| Task | Library |
|---|---|
| State management | zustand |
Constructing className strings conditionally |
clsx |
| Type-safe, variant-driven styling for Tailwind | cva |
| Theme switching / dark mode (no flash on load) | next-themes |
The styling split: clsx for ad-hoc conditional classes; cva when a component has real variants (size, intent, state) that deserve a typed API. They compose — cva uses clsx-style inputs internally.
Common mismatches to catch
- Toasts built by hand or with a modal library → Sonner exists for exactly this.
- A
<div>-based dropdown/dialog with manual focus handling → base-ui, which handles accessibility, focus trapping, and dismissal. - Animating a number by re-rendering text → NumberFlow handles digit transitions properly.
- Rendering a 1,000+ row list directly → Virtuoso before reaching for pagination hacks.
- A
useState-per-component web of props for shared state → zustand. - Template-literal className ternaries three conditions deep → clsx (or cva if it's variant-shaped).
常见问题
它会替换我项目已在使用的库吗?
不会。它可能会提出不同的推荐,但除非你要求,否则不会更改依赖项。
它会安装这个库吗?
当这是你请求的一部分时,它可以安装并完成配置。
如果我的任务不在列表中怎么办?
该技能会明确说明,然后基于通用知识给出推荐。
详情
作者的原始描述
Pick the right library for a given frontend task from a curated, opinionated list — numbers, OTP inputs, charts, command menus, virtualization, drag and drop, toasts, state, styling, and more. Only runs when explicitly invoked; it does not trigger on its own.
repo: spree/spree
热度
- GitHub 星标
- 16k
- 排名
- #10877
- 许可证
- BSD-3-Clause
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
animate
16k从零开始构建动画,先判断是否应该产生动效,再在编写代码之前确定其目的、时长和曲线。
animation-vocabulary
16k把对某个动画或动效的模糊描述,转换为其准确的技术名称,让你知道该问什么。
apple-design
16k把 Apple 的流畅设计理念带到网页上,涵盖响应式手势、弹簧动效、可中断的过渡和减少动态效果。
find-animation-opportunities
16k在界面中搜索最适合添加动效的地方,并排除其余部分。给出一份简短的精确动画建议清单,且不改动代码。