We value your feedback!

Can you spare a moment to take our survey?
Your feedback helps us improve Lucide and make it better for everyone.

Skip to content
Get React certificates from certificates.dev

全局样式

可以通过使用 颜色大小描边宽度 来调整图标。 要全局设置所有图标的样式,你可以使用上下文提供者。

上下文提供者

对于使用上下文提供者进行全局样式设置,你可以使用由 lucide-react-native 包提供的 LucideProvider 组件。

tsx
import { LucideProvider, Home } from 'lucide-react-native';

const App = () => (
  <LucideProvider
    color="red"
    size={48}
    strokeWidth={2}
  >
    <Home />
  </LucideProvider>
);

这会将 colorsizestrokeWidth 属性应用于 LucideProvider 的所有子图标。