Chuyển đến nội dung
Skillpedia
Giao diện (UI/UX)7.6k · #13183

shadcn-ui

Skill này làm gì

Skill này bảo agent dùng các phần giao diện có sẵn của ứng dụng và chủ đề của nó, thay vì đoán từ các ví dụ bên ngoài. Skill dành cho lập trình viên xây dựng hoặc thay đổi màn hình trong ứng dụng dùng các component kiểu shadcn.

Khi nào nên dùng

  • ✓Khi bạn thêm một hộp thoại, menu, form hoặc nút vào màn hình ứng dụng.
  • ✓Khi bạn đổi diện mạo một component và cần giữ đúng chủ đề.
  • ✓Khi bạn cần một phần giao diện mà ứng dụng có thể đã cung cấp sẵn.

Liên kết skill

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/shadcn-ui/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/shadcn-ui/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thêm một hộp thoại xác nhận có form vào màn hình này, dùng các nút và màu mà ứng dụng đã dùng.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đọc cấu hình component của ứng dụng và dùng các biến thể và màu chủ đề có sẵn. Nó nhập các điều khiển qua wrapper cục bộ của ứng dụng, thay vì thay đổi giao diện chung chỉ cho một màn hình.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

shadcn/ui and Local UI Adapters

Use the components already provided by the app. Read the app's design-system configuration, Toolkit provider, and local UI components before adding or changing a control. Their exports, variants, and props are the contract; do not guess from upstream examples.

Keep imports behind the local adapter

Product pages and domain components should import standard controls through the app's configured local UI alias. In the Chat starter, that is @/components/ui/*; its app/components/ui/button.tsx is a one-line re-export of @agent-native/toolkit/ui/button. Follow an adjacent local shim when the app needs another Toolkit primitive that is already exported there.

Use the app's configured design system and provider mapping for controls passed to shared Toolkit surfaces. For shared Toolkit feature presentation, use the semantic components exposed by @agent-native/toolkit/design-system; keep the feature behavior in its existing controller and customize only its supported presentation seam.

Compose existing controls

  • Prefer a primitive's built-in variant and size. Put page layout on a parent instead of overriding shared component appearance for one screen.
  • Use the app's semantic theme tokens for reusable UI, such as bg-background, text-muted-foreground, border-border, and bg-primary. Keep theme values in the app's existing CSS theme file.
  • Use the control that matches the choice: Switch for a binary setting, Checkbox for independent multi-select, RadioGroup for one choice from a short set, and Select or the app's combobox for a longer predefined list.
  • Compose cards and form fields from the primitives already available. Avoid adding explanatory copy that repeats a visible title or label; see frontend-design for the app's surface-density rules.
  • Put selectable items inside their menu or list group primitives. Keep tab triggers inside the tab list. Supply an accessible title to dialog, sheet, drawer, and alert-dialog content.
  • Match the trigger API to the actual local component. Toolkit wrappers may expose a different API from the upstream primitive; inspect its props before using options such as asChild or render.

Keep controls operable

Use the app's existing field components and validation pattern. Associate errors with their inputs and expose invalid state to assistive technology. Icon-only actions need an accessible name and a usable focus target. Use the icon package already installed by the app.

Do not recreate menus, popovers, dialogs, or confirmations with absolute positioning and custom click-outside handlers. Never use browser alert, confirm, or prompt; use the app's dialog primitives. Keep overlay focus, keyboard, dismissal, and stacking behavior from the existing primitive.

For small visual refinements, use layout classes and semantic tokens. Avoid raw palette overrides, arbitrary one-off values, and manual overlay z-index unless you are fixing a reproduced bug. Use gap-* for layout spacing and the app's class-merging helper when it has one.

Related skill

  • frontend-design — Product UX, density, visual direction, and responsive behavior.
Câu hỏi thường gặp

Tôi có nên ghi đè kiểu của component cho một trang không?

Không. Skill nói nên đặt bố cục trang ở phần tử cha thay vì thay đổi giao diện chung.

Màu chủ đề nên lấy từ đâu?

Từ các token chủ đề của ứng dụng, chẳng hạn bg-background hoặc text-muted-foreground.

Nếu ví dụ upstream trông khác thì sao?

Các export, biến thể và props của chính ứng dụng là tài liệu tham chiếu.

Chi tiết

Mô tả gốc của tác giả

Using the app's local UI adapter and Toolkit or shadcn primitives. Use when choosing or composing standard controls, implementing dialogs, menus, or forms, or changing component variants and theme tokens.

repo: BuilderIO/agent-native

Độ phổ biến

Sao GitHub
7.6k
Vị trí xếp hạng
#13183
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự