Icon Components
All icon components share a consistent interface and styling approach.Common Props
All icon components accept the following prop:CSS classes to apply to the SVG element. Each icon has a sensible default size.
Common Features
- SVG-based for sharp rendering at any size
- Responsive to text color via
currentColor - Optimized paths from standard icon libraries
- Consistent sizing defaults
- Accessible when used with proper ARIA labels
Navigation & Action Icons
ArrowIcon
ArrowIcon
A diagonal arrow icon commonly used for links and CTAs indicating external navigation or forward movement.Default size: Features:
w-4 h-4Usage:- Stroke-based rendering
- 2px stroke width
- Round line caps and joins
- Points diagonally up-right
CheckIcon
CheckIcon
A checkmark icon for success states and confirmations.Default size:
w-5 h-5Usage:CopyIcon
CopyIcon
A duplicate/copy icon for clipboard operations.Default size:
w-5 h-5Usage:Social Media Icons
All social icons default tow-6 h-6 and use filled rendering for bold, recognizable branding.
GitHubIcon
GitHubIcon
GitHub logo icon.Usage:Path data: Complete GitHub Octocat logo path
XIcon (Twitter)
XIcon (Twitter)
X (formerly Twitter) logo icon.Usage:Path data: Modern X logo design
LinkedInIcon
LinkedInIcon
LinkedIn logo icon.Usage:Path data: Official LinkedIn logo
DevToIcon
DevToIcon
Dev.to logo icon for developer community.Usage:
EmailIcon
EmailIcon
Email envelope icon. Uses stroke rendering unlike other social icons.Default size: Rendering: Stroke-based with 2px width, round caps
w-6 h-6Usage:FacebookIcon
FacebookIcon
Facebook logo icon.Usage:
HackerNewsIcon
HackerNewsIcon
Hacker News logo icon.Usage:
PinterestIcon
PinterestIcon
Pinterest logo icon.Usage:
RedditIcon
RedditIcon
Reddit logo icon.Usage:
TelegramIcon
TelegramIcon
Telegram logo icon.Usage:
WhatsAppIcon
WhatsAppIcon
WhatsApp logo icon.Usage:
Icon Usage Patterns
With Social Links
Icons are commonly used with the SocialLink component:With Buttons
Icons enhance button actions:With Notifications
Icons provide visual context:Icon Customization
Size Variants
Common size classes for icons:Color Variants
Icons inherit color from parent or can be colored directly:Animation
Icons can be animated with Tailwind utilities:Icon Structure
All icon components follow this structure:Key Attributes
Accepts any Tailwind or custom CSS classes for sizing and styling
Usually
currentColor to inherit parent text color. Some icons use none for stroke-based rendering.Used in stroke-based icons like ArrowIcon and EmailIcon. Also set to
currentColor.Standard
0 0 24 24 for consistent sizing across all iconsCreating Custom Icons
To add a new icon to the UI components:- Create the component file:
- Export from the icons barrel file:
- Use in components:
Finding SVG Path Data
Sources for icon paths:- Heroicons - Stroke and solid variants
- Simple Icons - Brand icons
- Lucide Icons - Clean, consistent set
- Iconify - Massive icon collection
Optimization Tips
- Use SVGO to optimize path data
- Prefer
currentColorfor fill/stroke - Keep viewBox at
0 0 24 24for consistency - Remove unnecessary attributes
- Simplify complex paths when possible
Icon Export Structure
Icons are exported from the barrel file at:~/workspace/source/src/components/ui/icons/index.ts
Current exports:
Best Practices
Accessibility
Accessibility
- Add
aria-labelto parent links/buttons - Use descriptive labels like “Visit my GitHub profile”
- Don’t rely on icons alone for meaning
- Provide text alternatives when needed
Performance
Performance
- Icons are inline SVGs (no extra HTTP requests)
- Small file size per icon
- Rendered as part of the document
- No JavaScript required
Consistency
Consistency
- Use consistent sizing across similar elements
- Maintain 24x24 viewBox for all custom icons
- Use
currentColorfor theme compatibility - Follow the established component structure
Theming
Theming
All icons automatically adapt to theme changes:
- Light theme: Inherits dark text colors
- Dark theme: Inherits light text colors
- Retro theme: Works with custom theme colors
- No additional CSS required
Future UI Components
The UI components directory is designed to accommodate:- Button primitives - Reusable button styles
- Input components - Styled form inputs
- Badge components - Labels and tags
- Avatar components - User profile images
- Skeleton loaders - Loading states
- Tooltip components - Contextual help