Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mintlify/components/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Icon component renders icons from various sources including FontAwesome, Lucide, language icons, and custom images. It supports multiple icon styles, custom colors, and sizes.Basic Usage
Props
The icon identifier. Can be:
- FontAwesome icon name (e.g., “star”, “heart”, “user”)
- Lucide icon name (e.g., “rocket”, “settings”, “home”)
- Absolute URL to an image
- Relative path starting with
/ - Language name for programming language icons (e.g., “javascript”, “python”)
The icon library to use:
fontawesome: FontAwesome icons (default)lucide: Lucide icons
iconType
'brands' | 'duotone' | 'light' | 'regular' | 'sharp-duotone-solid' | 'sharp-light' | 'sharp-regular' | 'sharp-solid' | 'sharp-thin' | 'solid' | 'thin'
default:"regular"
The FontAwesome icon style type. Different styles provide varying visual weights:
regular: Standard weight (default)solid: Filled solid iconslight: Lighter weight iconsthin: Thinnest weight iconsbrands: Brand logos (automatically detected for known brands)duotone: Two-tone colored iconssharp-*: Sharp-cornered variants
Size of the icon in pixels. Sets both width and height.
When true, doesn’t apply the
size prop, allowing external CSS to control dimensions.Custom color for the icon. Accepts any valid CSS color value (hex, rgb, named colors).Example:
"#FF0000", "rgb(255, 0, 0)", "red"Custom color for light mode. Must be used together with
colorDark.Custom color for dark mode. Must be used together with
colorLight.When true, doesn’t apply default color styling, allowing external CSS to control color.
Additional CSS classes to apply to the icon.
Base path to prepend to relative icon URLs (those starting with
/).The page type affects rendering:
pdf: Renders as<img>tag for PDF compatibilitydefaultorminimal: Renders as<svg>with mask for CSS control
Examples
FontAwesome Icons
Lucide Icons
Custom Sizes
Custom Colors
Custom Image Icons
Language Icons
The component automatically detects programming language names and loads appropriate icons:Override Styling
In Context
Features
Automatic Brand Detection
Known brand icons (like GitHub, Twitter, Facebook) are automatically detected and loaded from the brands library, even without explicitly settingiconType="brands".
SVG Masking
For library icons (FontAwesome and Lucide), the component uses CSS masking, which allows:- Dynamic color changes via CSS
- Smooth color transitions
- Dark mode color switching
- Gradient backgrounds
Image Rendering
For custom image URLs:- Absolute URLs are rendered as
<img>tags - Relative paths are resolved using
basePath - Mintlify CDN URLs use SVG masking for color control
Icon Libraries
Supported icon sources:- FontAwesome v7.1.0: Comprehensive icon library with multiple styles
- Lucide v0.545.0: Modern, consistent icon set
- Devicon: Programming language and technology logos
- Custom images: Any SVG or raster image
Dark Mode
Automatic dark mode support:- Default icons adapt to theme (dark in light mode, light in dark mode)
- Use
colorLightandcolorDarkfor custom theme colors - Maintains proper contrast ratios
PDF Support
WhenpageType="pdf", icons render as <img> tags for better PDF compatibility.
Styling
The Icon component:- Renders inline by default (
display: inline-block) - Aligns vertically to middle
- Respects parent text color when no custom color is set
- Can be styled with Tailwind or custom CSS classes
Default Behavior
- Default library: FontAwesome
- Default type: Regular
- Default size: 16px
- Default color: Inherits from theme (dark in light mode, light in dark mode)
Notes
For consistent sizing in flex layouts, use
overrideSize and control dimensions with CSS classes like size-4, w-6 h-6, etc.When using
colorLight and colorDark, both props must be provided together. Using only one will be ignored.Invalid
iconType values are logged to console and result in no icon being rendered. Valid types are: brands, duotone, light, regular, sharp-solid, solid, thin.