icon-system
Implements scalable icon systems with SVG sprites or React/Vue components. Use when setting up icon libraries, creating icon sizing tokens, optimizing SVGs…

Установить icon-system в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Icon System
Overview
Implement a scalable icon system with SVG sprites or icon components, proper sizing tokens, consistent stroke widths, and accessibility. Covers both sprite-based and component-based approaches.
When to Use
- Setting up icons for a new design system
- Converting icon fonts to SVG
- Creating an icon component library
- Establishing icon sizing standards
- Making icons accessible
Quick Reference: Approaches
| Approach | Best For | Bundle Size | Styling |
|---|---|---|---|
| SVG Sprite | Large icon sets, caching | One request | CSS limited |
| Inline SVG Components | Tree-shaking, full control | Per-icon | Full CSS |
| Icon Font | Legacy support | One request | Limited |
| External SVG | Simple sites | Per-icon | Limited |
The Process
- Choose approach: Sprite vs components based on project needs
- Define size scale: Icon size tokens (xs, sm, md, lg, xl)
- Establish stroke width: Consistent line weights
- Create component: Wrapper with accessibility
- Build tooling: Optimization, sprite generation
Size Tokens
Icon Size Scale
:root {
/* Icon sizes - match common UI patterns */
--icon-size-xs: 0.75rem; /* 12px - inline text */
--icon-size-sm: 1rem; /* 16px - small buttons */
--icon-size-md: 1.25rem; /* 20px - default */
--icon-size-lg: 1.5rem; /* 24px - large buttons */
--icon-size-xl: 2rem; /* 32px - feature icons */
--icon-size-2xl: 2.5rem; /* 40px - hero icons */
--icon-size-3xl: 3rem; /* 48px - illustrations */
}
Tailwind Config
// tailwind.config.js
module.exports = {
theme: {
extend: {
width: {
'icon-xs': '0.75rem',
'icon-sm': '1rem',
'icon-md': '1.25rem',
'icon-lg': '1.5rem',
'icon-xl': '2rem',
},
height: {
'icon-xs': '0.75rem',
'icon-sm': '1rem',
'icon-md': '1.25rem',
'icon-lg': '1.5rem',
'icon-xl': '2rem',
},
},
},
};
JSON Tokens
{
"icon": {
"size": {
"xs": { "value": "0.75rem", "description": "12px - inline" },
"sm": { "value": "1rem", "description": "16px - small buttons" },
"md": { "value": "1.25rem", "description": "20px - default" },
"lg": { "value": "1.5rem", "description": "24px - large buttons" },
"xl": { "value": "2rem", "description": "32px - feature icons" }
},
"stroke": {
"thin": { "value": "1" },
"regular": { "value": "1.5" },
"medium": { "value": "2" },
"bold": { "value": "2.5" }
}
}
}
Approach 1: Inline SVG Components (Recommended)
Best for React, Vue, Svelte. Tree-shakeable, full styling control.
React Icon Component
// components/Icon.tsx
import { forwardRef, SVGProps } from 'react';
import clsx from 'clsx';
type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
interface IconProps extends SVGProps<SVGSVGElement> {
size?: IconSize;
label?: string; // Accessible label
}
const sizeMap: Record<IconSize, string> = {
xs: 'w-3 h-3', // 12px
sm: 'w-4 h-4', // 16px
md: 'w-5 h-5', // 20px
lg: 'w-6 h-6', // 24px
xl: 'w-8 h-8', // 32px
};
export const Icon = forwardRef<SVGSVGElement, IconProps>(
({ size = 'md', label, className, children, ...props }, ref) => {
return (
<svg
ref={ref}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={clsx(sizeMap[size], className)}
aria-hidden={!label}
aria-label={label}
role={label ? 'img' : 'presentation'}
{...props}
>
{children}
</svg>
);
}
);
Individual Icon Components
// icons/ChevronDown.tsx
import { Icon, IconProps } from '../Icon';
export function ChevronDown(props: IconProps) {
return (
<Icon {...props}>
<polyline points="6 9 12 15 18 9" />
</Icon>
);
}
// icons/Check.tsx
export function Check(props: IconProps) {
return (
<Icon {...props}>
<polyline points="20 6 9 17 4 12" />
</Icon>
);
}
// icons/X.tsx
export function X(props: IconProps) {
return (
<Icon {...props}>
<line x1="18" y1="6" x2="6" y2="18" />
<line x1="6" y1="6" x2="18" y2="18" />
</Icon>
);
}
Icon Index with Tree-Shaking
// icons/index.ts
export { ChevronDown } from './ChevronDown';
export { Check } from './Check';
export { X } from './X';
export { Search } from './Search';
// ... etc
// Usage - only imports what's used
import { ChevronDown, Check } from '@/icons';
Usage Examples
// Basic usage
<ChevronDown />
// With size
<Check size="lg" />
// With accessible label (for meaningful icons)
<X label="Close dialog" />
// Custom styling
<Search className="text-gray-400" size="sm" />
// In a b
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл icon-system?
Implements scalable icon systems with SVG sprites or React/Vue components. Use when setting up icon libraries, creating icon sizing tokens, optimizing SVGs, or building accessible icon buttons.
Как установить скилл icon-system?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл icon-system запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
