Skip to main content

Agent Skills - Phần 15: Icon System Cheatsheet (Lucide)

Tóm tắt

Tài liệu tổng hợp icon phổ biến từ Lucide dùng trong web app (React/Next.js), giúp chọn icon đúng ngữ nghĩa (navigation, action, status, commerce, data, security...), copy nhanh import code và JSX usage, và áp dụng accessibility đúng cách (aria-label, aria-hidden). Mỗi icon được phân loại theo category và có ví dụ code cụ thể. Nội dung dựa trên icons.csv từ ui-ux-pro-max-skill, giúp developers và AI Agents sử dụng icon system hiệu quả và accessible.

Tài liệu này tổng hợp icon phổ biến từ Lucide dùng trong web app (React/Next.js), giúp Agent:

  • Chọn icon đúng ngữ nghĩa (navigation, action, status, commerce, data, security...).
  • Copy nhanh import code + JSX usage.
  • Áp dụng accessibility đúng cách (aria-label, aria-hidden...).

Nguồn: icons.csv từ ui-ux-pro-max-skill.


1. Hướng dẫn dùng icon + accessibility

  • Decorative icon (chỉ để đẹp, không mang nghĩa riêng):
    • Thêm aria-hidden="true" hoặc role="presentation".
    • Không dùng aria-label.
  • Icon button / icon-only:
    • Bắt buộc có accessible name qua aria-label hoặc aria-labelledby.
    • Ví dụ:
+ <button aria-label="Close menu">
+ <X className="h-4 w-4" />
+ </button>
  • Icon kèm text:
    • Icon có thể aria-hidden="true", text mang nghĩa chính.
+ <Button>
+ <Download aria-hidden="true" className="mr-2 h-4 w-4" />
+ Download
+ </Button>

2. Navigation Icons

PurposeIconImportUsage
Menu toggleMenuimport { Menu } from 'lucide-react'<Menu />
BackArrowLeftimport { ArrowLeft } from 'lucide-react'<ArrowLeft />
Next / ContinueArrowRightimport { ArrowRight } from 'lucide-react'<ArrowRight />
DropdownChevronDownimport { ChevronDown } from 'lucide-react'<ChevronDown />
CollapseChevronUpimport { ChevronUp } from 'lucide-react'<ChevronUp />
HomeHomeimport { Home } from 'lucide-react'<Home />
CloseXimport { X } from 'lucide-react'<X />
External linkExternalLinkimport { ExternalLink } from 'lucide-react'<ExternalLink />

3. Action Icons

ActionIconImport
Add / NewPlusimport { Plus } from 'lucide-react'
RemoveMinusimport { Minus } from 'lucide-react'
DeleteTrash2import { Trash2 } from 'lucide-react'
EditEditimport { Edit } from 'lucide-react'
SaveSaveimport { Save } from 'lucide-react'
DownloadDownloadimport { Download } from 'lucide-react'
UploadUploadimport { Upload } from 'lucide-react'
CopyCopyimport { Copy } from 'lucide-react'
ShareShareimport { Share } from 'lucide-react'
SearchSearchimport { Search } from 'lucide-react'
FilterFilterimport { Filter } from 'lucide-react'
SettingsSettingsimport { Settings } from 'lucide-react'

4. Status & Feedback Icons

StatusIconImport
SuccessCheckimport { Check } from 'lucide-react'
Success badgeCheckCircleimport { CheckCircle } from 'lucide-react'
Error / FailedXCircleimport { XCircle } from 'lucide-react'
WarningAlertTriangleimport { AlertTriangle } from 'lucide-react'
InfoAlertCircleimport { AlertCircle } from 'lucide-react'
Info (tooltip)Infoimport { Info } from 'lucide-react'
LoadingLoaderimport { Loader } from 'lucide-react'
Pending / TimeClockimport { Clock } from 'lucide-react'

Ví dụ spinner:

+ <Loader className="h-4 w-4 animate-spin" aria-hidden="true" />

5. Communication & Notifications

Use caseIconImport
EmailMailimport { Mail } from 'lucide-react'
Chat / CommentMessageCircleimport { MessageCircle } from 'lucide-react'
PhonePhoneimport { Phone } from 'lucide-react'
SendSendimport { Send } from 'lucide-react'
NotificationsBellimport { Bell } from 'lucide-react'

6. User & Auth

Use caseIconImport
ProfileUserimport { User } from 'lucide-react'
TeamUsersimport { Users } from 'lucide-react'
Invite userUserPlusimport { UserPlus } from 'lucide-react'
LoginLogInimport { LogIn } from 'lucide-react'
LogoutLogOutimport { LogOut } from 'lucide-react'

7. Media Controls

Use caseIconImport
ImageImageimport { Image } from 'lucide-react'
VideoVideoimport { Video } from 'lucide-react'
PlayPlayimport { Play } from 'lucide-react'
PausePauseimport { Pause } from 'lucide-react'
VolumeVolume2import { Volume2 } from 'lucide-react'
MicrophoneMicimport { Mic } from 'lucide-react'
CameraCameraimport { Camera } from 'lucide-react'

8. Commerce & Pricing

Use caseIconImport
CartShoppingCartimport { ShoppingCart } from 'lucide-react'
Bag / PurchaseShoppingBagimport { ShoppingBag } from 'lucide-react'
PaymentCreditCardimport { CreditCard } from 'lucide-react'
Price / MoneyDollarSignimport { DollarSign } from 'lucide-react'
Price tagTagimport { Tag } from 'lucide-react'
Gift / RewardGiftimport { Gift } from 'lucide-react'
DiscountPercentimport { Percent } from 'lucide-react'

9. Data, Analytics & Dev

Use caseIconImport
Bar chartBarChartimport { BarChart } from 'lucide-react'
Pie chartPieChartimport { PieChart } from 'lucide-react'
Trend upTrendingUpimport { TrendingUp } from 'lucide-react'
Trend downTrendingDownimport { TrendingDown } from 'lucide-react'
Activity / PulseActivityimport { Activity } from 'lucide-react'
DatabaseDatabaseimport { Database } from 'lucide-react'
TerminalTerminalimport { Terminal } from 'lucide-react'
CodeCodeimport { Code } from 'lucide-react'
Git branchGitBranchimport { GitBranch } from 'lucide-react'
GitHubGithubimport { Github } from 'lucide-react'

10. Files, Layout & Devices

Use caseIconImport
FileFileimport { File } from 'lucide-react'
File textFileTextimport { FileText } from 'lucide-react'
FolderFolderimport { Folder } from 'lucide-react'
Folder openFolderOpenimport { FolderOpen } from 'lucide-react'
AttachmentPaperclipimport { Paperclip } from 'lucide-react'
LinkLinkimport { Link as LinkIcon } from 'lucide-react'
ClipboardClipboardimport { Clipboard } from 'lucide-react'

10.2 Layout & View Modes

Use caseIconImport
Grid viewGridimport { Grid } from 'lucide-react'
List viewListimport { List } from 'lucide-react'
ColumnsColumnsimport { Columns } from 'lucide-react'
MaximizeMaximizeimport { Maximize } from 'lucide-react'
MinimizeMinimizeimport { Minimize } from 'lucide-react'
SidebarSidebarimport { Sidebar } from 'lucide-react'

10.3 Devices

DeviceIconImport
MobileSmartphoneimport { Smartphone } from 'lucide-react'
TabletTabletimport { Tablet } from 'lucide-react'
MonitorMonitorimport { Monitor } from 'lucide-react'
LaptopLaptopimport { Laptop } from 'lucide-react'
PrinterPrinterimport { Printer } from 'lucide-react'

11. Security & Privacy

Use caseIconImport
Lock/secureLockimport { Lock } from 'lucide-react'
UnlockUnlockimport { Unlock } from 'lucide-react'
Shield/protectShieldimport { Shield } from 'lucide-react'
Key/passwordKeyimport { Key } from 'lucide-react'
Show passwordEyeimport { Eye } from 'lucide-react'
Hide passwordEyeOffimport { EyeOff } from 'lucide-react'

12. Location & Time

12.1 Location

Use caseIconImport
LocationMapPinimport { MapPin } from 'lucide-react'
MapMapimport { Map } from 'lucide-react'
NavigationNavigationimport { Navigation } from 'lucide-react'
GlobeGlobeimport { Globe } from 'lucide-react'

12.2 Time & History

Use caseIconImport
Calendar/dateCalendarimport { Calendar } from 'lucide-react'
RefreshRefreshCwimport { RefreshCw } from 'lucide-react'
UndoRotateCcwimport { RotateCcw } from 'lucide-react'
RedoRotateCwimport { RotateCw } from 'lucide-react'

13. Social & Feedback

Use caseIconImport
Like / LoveHeartimport { Heart } from 'lucide-react'
Star / RatingStarimport { Star } from 'lucide-react'
Thumbs upThumbsUpimport { ThumbsUp } from 'lucide-react'
Thumbs downThumbsDownimport { ThumbsDown } from 'lucide-react'
BookmarkBookmarkimport { Bookmark } from 'lucide-react'
Flag / ReportFlagimport { Flag } from 'lucide-react'

14. Tips chọn icon hệ thống

  • Một concept → một icon nhất quán (ví dụ delete luôn dùng Trash2).
  • Không trộn quá nhiều style icon (ở đây: dùng Lucide outline là chủ đạo).
  • Size & stroke:
    • Dùng h-4 w-4 hoặc h-5 w-5 cho button, h-3 w-3 cho inline text.
  • Khoảng cách:
+ <Icon className="mr-2 h-4 w-4" aria-hidden="true" />
+ <span>Label</span>
  • i18n: Với icon-only button, label bằng text localizable trong aria-label.

Nguồn dữ liệu: icons.csvui-ux-pro-max-skill.