Custom Icons
Dynamic SVG icon loading from assets/icons directory. Simply add SVG files to the icons folder and reference them by name.
Basic Usage
Simple examples of the custom Icon component with different icons and sizes.
Different Sizes
Icons can be sized using numbers or strings with units.
Max Width Control
Use the maxWidth prop to control the maximum width of the icon, useful for responsive design.
Custom Classes
Apply custom CSS classes for styling, including color classes.
Error Handling
The component gracefully handles missing or invalid icons.
Usage Examples
Code examples showing how to use the Icon component in different contexts.
<!-- Basic usage -->
<CustomIcon name="persona" size="24" />
<!-- With custom class -->
<CustomIcon name="rocket" size="32" class="" />
<!-- In buttons -->
<q-btn>
<CustomIcon name="astronaut" size="16" class="q-mr-sm" />
Launch
</q-btn>
<!-- In cards -->
<q-card>
<q-card-section>
<CustomIcon name="persona" size="48" class="text-accent" />
<h6>User Profile</h6>
</q-card-section>
</q-card>Interactive Examples
Live examples of icons used in buttons, cards, and other components.
Button Examples
Card Examples
Rocket Card
Perfect for launch-related features
Astronaut Card
Great for exploration features
Persona Card
Ideal for user-related features
customIcons.workspaceCard
customIcons.workspaceCardDescription
customIcons.projectCard
customIcons.projectCardDescription
customIcons.profileCard
customIcons.profileCardDescription
Adding New Icons
Learn how to add new icons to your project.
Download SVG Files
Download SVG files from TheNounProject.com or other sources and save them to the assets/icons directory.
Name Your Files
Name your SVG files descriptively (e.g., 'user-profile.svg', 'settings-gear.svg').
Use in Components
Reference your icons by filename (without .svg extension) in the Icon component.