Capítulo 84 de 147

Chapter 84: Global Styling

Core Idea

Learn how to style all Lucide icons globally in your Preact application using CSS or the Lucide context provider.

Key Concepts

  • The color of the icons can be changed using the color CSS property.
  • The size of the icons can be changed using width and height CSS properties.
  • The stroke width of the icons can be changed using the stroke-width CSS property.

Code Examples

import { LucideProvider, Home } from 'lucide-preact';

const App = () => (
  <LucideProvider
    color="red"
    size={48}
    strokeWidth={2}
  >
    <Home />
  </LucideProvider>
);
  • What it demonstrates: Global Styling usage pattern from the official Lucide docs.

Key Takeaways

  1. The color of the icons can be changed using the color CSS property.
  2. The size of the icons can be changed using width and height CSS properties.
  3. The stroke width of the icons can be changed using the stroke-width CSS property.

Connects To

  • Preact: part of the Preact section of the Lucide docs.
  • Lucide for Preact: overview page for this section.