Colibri Icon Library
A comprehensive icon system for the Telesign Design System, built with Lit components and optimized SVG loading.

Table of Contents
Installation
npm install @telesign/colibri-icons
Basic Usage
Register the Component
import { ColIcon } from '@telesign/colibri-icons';
customElements.define('col-icon', ColIcon);
Use in HTML
<col-icon name="message" color="#000000" size="24px"></col-icon>
Use in JavaScript/TypeScript
import { html } from 'lit';
html` <col-icon name="lock" color="currentColor" size="20px"></col-icon> `;
Advanced Usage
Dynamic Color Inheritance
The icon component can inherit colors from its parent:
<div style="color: blue">
<col-icon name="user" color="currentColor"></col-icon>
</div>
Size Variations
Supports both pixel and relative units:
<col-icon name="search" size="24px"></col-icon>
<col-icon name="menu" size="32"></col-icon>
<col-icon name="settings" size="2rem"></col-icon>
Icon Caching
Icons are automatically cached for better performance:
<col-icon name="user"></col-icon>
<col-icon name="user"></col-icon>
Component API
Properties
name | string | 'lock' | Icon name to display |
color | string | 'currentColor' | Icon color |
size | string|number | '24px' | Icon size |
CSS Custom Properties
The component can be styled using CSS:
col-icon {
display: inline-block;
line-height: 0;
}
.icon-container {
width: 100%;
height: 100%;
}
Adding Icons
1. Prepare SVG Files
- Export SVG from design tools (e.g., Figma)
- Ensure proper naming convention
- Optimize SVG content
2. Add to Project
src/
icons/
my-new-icon.svg
3. SVG Requirements
- Monochromatic design
- Clean, optimized markup
- Proper viewBox attribute
- No hardcoded colors (unless using
currentColor)
Example of a proper SVG:
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2L2 7l10 5 10-5-10-5z" fill="currentColor"/>
</svg>
Development
Local Development
npm install
npm run dev
npm run preview
Available Scripts
npm run build
npm run lint
npm run lint:fix
npm run format
npm test
npm run test:watch
npm run test:coverage
npm run test:headless
npm run test:visual
npm run test:debug
npm test -- --files="src/components/col-icon.test.ts"
npm test -- --files="src/components/**/*.test.ts"
Best Practices
1. Icon Naming
name = 'user-profile';
name = 'shopping-cart';
name = 'icon1';
name = 'newicon';
2. Color Management
<col-icon color="currentColor"></col-icon>
<col-icon color="#FF0000"></col-icon>
<svg fill="#000000">...</svg>
3. Size Handling
<col-icon size="24px"></col-icon>
<col-icon size="2rem"></col-icon>
<col-icon size="24"></col-icon>
Troubleshooting
Common Issues
<col-icon name="exact-file-name"></col-icon>
<col-icon color="blue"></col-icon>
<col-icon size="24px"></col-icon> // Good
<col-icon size="24"></col-icon> // May cause issues
Performance Considerations
- Icons are cached automatically
- Cache is shared across instances
- Cache is keyed by icon name and color
- SVGs are minified during build
- Unnecessary attributes are removed
- Inline styles are optimized
- Icons are loaded on demand
- Failed loads are handled gracefully
- Cache prevents unnecessary reloads
Changelog
See CHANGELOG.md for a detailed list of changes and version history.
Contributing
We welcome contributions to this icon library. Please feel free to submit pull requests with new icons or improvements.
License
This project is licensed under the MIT License - see the LICENSE file for details.
About Telesign
Telesign helps the world's largest brands connect, protect, and engage with their customers through powerful communication channels.