### Install Solar Icons for Nuxt Source: https://solar-icons.vercel.app/docs/getting-started/installation Use the dedicated Nuxt module for seamless integration, including auto-import capabilities and global configuration. ```shell nuxi module add @solar-icons/nuxt ``` -------------------------------- ### Install Solar Icons for React Source: https://solar-icons.vercel.app/docs/getting-started/installation Install the standard React package for maximum versatility or the performance package for reduced bundle size. These packages allow for dynamic style changes or single-style integration respectively. ```shell npm install @solar-icons/react ``` ```shell npm install @solar-icons/react-perf ``` -------------------------------- ### Install Solar Icons Package Source: https://solar-icons.vercel.app/docs/packages/react-native Commands to install the Solar Icons library using various package managers. ```bash npm install @solar-icons/react-native ``` -------------------------------- ### Install Solar Icons for Vue Source: https://solar-icons.vercel.app/docs/getting-started/installation Install the official Vue package to access the full feature set of Solar Icons, including multi-style support and category imports. ```shell npm install @solar-icons/vue ``` -------------------------------- ### Import Icons from Style Entry Points (Performance Package) Source: https://solar-icons.vercel.app/docs/getting-started/usage Demonstrates importing icons directly from style-specific entry points in the '@solar-icons/react-perf' package, such as '@solar-icons/react-perf/bold'. This approach can lead to cleaner import statements. ```javascript import { Home } from '@solar-icons/react-perf/bold' import { Settings } from '@solar-icons/react-perf/linear' export default function MyComponent() { return (
) } ``` -------------------------------- ### Implement Server-Side Rendering with Solar Icons Source: https://solar-icons.vercel.app/docs/advanced/server-side-rendering Demonstrates how to import icons from the /ssr entry point to create pure, stateless server components. This approach avoids React Context and is ideal for optimizing server-rendered HTML. ```javascript import { ArrowUp } from '@solar-icons/react/ssr' export default function ServerComponent() { return (

My Page

) } ``` -------------------------------- ### Install @solar-icons/svelte Package Source: https://solar-icons.vercel.app/docs/packages/svelte Installs the @solar-icons/svelte package using npm. This is the first step to using Solar Icons in your Svelte project. ```bash npm install @solar-icons/svelte ``` -------------------------------- ### Vue Plugin Installation for Global Configuration Source: https://solar-icons.vercel.app/docs/packages/vue Illustrates installing the Solar Icons package as a Vue plugin for global configuration. This method allows setting default icon properties when initializing the Vue application. ```javascript import { createApp } from 'vue' import { SolarIconsPlugin } from '@solar-icons/vue' const app = createApp(App) app.use(SolarIconsPlugin, { color: 'currentColor', size: '24', weight: 'Linear', mirrored: false, }) app.mount('#app') ``` -------------------------------- ### Import and Use Icons (Performance Package) Source: https://solar-icons.vercel.app/docs/getting-started/usage Illustrates importing style-specific icons like 'HomeBold' and 'HomeLinear' from the '@solar-icons/react-perf' package. This package is optimized for smaller bundle sizes by providing individual icon components for each style. ```javascript import { HomeBold, HomeLinear } from '@solar-icons/react-perf' export default function MyComponent() { return (
) } ``` -------------------------------- ### Import and Use Home Icon (Standard Package) Source: https://solar-icons.vercel.app/docs/getting-started/usage Demonstrates how to import the 'Home' icon from the '@solar-icons/react' package and use it as a React component. This package allows switching between icon styles using the 'weight' prop. ```javascript import { Home } from '@solar-icons/react' export default function MyComponent() { return } ``` -------------------------------- ### Global Configuration with SolarProvider Component Source: https://solar-icons.vercel.app/docs/packages/nuxt Example of using the `SolarProvider` component to set global default configurations for Solar Icons within your Nuxt application. This allows overriding module-level defaults for specific parts of your application. ```html ``` -------------------------------- ### Advanced TypeScript Integration Source: https://solar-icons.vercel.app/docs/packages/react-native Examples of using icon refs with Svg types and creating a custom wrapper component for dynamic icon rendering. ```typescript import type { IconProps, Icon } from '@solar-icons/react-native'; import { useRef } from 'react'; import { Svg } from 'react-native-svg'; const MyComponent = () => { const iconRef = useRef(null); return ; }; // Custom Icon Wrapper import * as Icons from '@solar-icons/react-native/Bold'; interface MyIconProps extends IconProps { name: keyof typeof Icons; } export const AppIcon = ({ name, ...props }: MyIconProps) => { const IconComponent = Icons[name]; return ; }; ``` -------------------------------- ### Install @solar-icons/react Package Source: https://solar-icons.vercel.app/docs/packages/react Installs the @solar-icons/react package using npm. This package provides Solar Icons for React applications with support for dynamic styles and global configuration. ```bash npm install @solar-icons/react ``` -------------------------------- ### Install @solar-icons/react-perf Source: https://solar-icons.vercel.app/docs/packages/react-perf Installs the performance-optimized Solar Icons package for React using npm. This command is essential for adding the library to your project's dependencies. ```bash npm install @solar-icons/react-perf ``` -------------------------------- ### Configure @solar-icons/nuxt Module in nuxt.config.ts Source: https://solar-icons.vercel.app/docs/packages/nuxt Example configuration for the @solar-icons/nuxt module in your Nuxt project's `nuxt.config.ts` file. This allows customization of icon prefixes, auto-import settings, and default icon properties. ```typescript // nuxt.config.ts export default defineNuxtConfig({ modules: ['@solar-icons/nuxt'], solarIcons: { // Prefix for auto-imported components (default: 'Solar') namePrefix: 'Solar', // Auto-import all icons as components (default: true) autoImport: true, // Inject global provider automatically (default: true) provider: true, // Default icon properties color: 'currentColor', size: 24, weight: 'Linear', mirrored: false, }, }) ``` -------------------------------- ### Change Home Icon Style (Standard Package) Source: https://solar-icons.vercel.app/docs/getting-started/usage Shows how to change the visual style (weight) of the 'Home' icon using the 'weight' prop in the '@solar-icons/react' package. Available weights include Bold, Linear, Outline, BoldDuotone, LineDuotone, and Broken. ```javascript import { Home } from '@solar-icons/react' export default function MyComponent() { // This will render the "Bold" version of the Home icon. return } ``` -------------------------------- ### Import Strategies for Solar Icons Source: https://solar-icons.vercel.app/docs/packages/react-native Demonstrates three ways to import icons: style-specific bundles, global styled exports, and granular category imports for optimal tree-shaking. ```typescript import { Home, User, Settings } from '@solar-icons/react-native/Bold'; import { HomeBold, HomeLinear, HeartBroken } from '@solar-icons/react-native'; import { Home } from '@solar-icons/react-native/category/ui/Bold/Home'; ``` -------------------------------- ### Basic Icon Usage in Svelte Source: https://solar-icons.vercel.app/docs/packages/svelte Demonstrates how to import and use a Solar Icon component (e.g., Home) within a Svelte component. It shows how to set the size and color props. ```svelte ``` -------------------------------- ### Direct Individual Icon Import in Svelte Source: https://solar-icons.vercel.app/docs/packages/svelte Demonstrates the most efficient way to import icons for optimal tree-shaking by importing individual icon components directly. This ensures only the used icon is included in the bundle. ```svelte ``` -------------------------------- ### Importing Multiple Icons by Style in Svelte Source: https://solar-icons.vercel.app/docs/packages/svelte Shows how to import multiple icons from a specific style (e.g., Bold) and also from another style (e.g., Linear) in Svelte. This allows for easy access to a set of related icons. ```svelte ``` -------------------------------- ### Access IconStyle Enum Source: https://solar-icons.vercel.app/docs/packages/react-native Shows how to import the IconStyle enum to handle dynamic icon styling logic. ```typescript import { IconStyle } from '@solar-icons/react-native'; // Values: 'Bold', 'BoldDuotone', 'Broken', 'LineDuotone', 'Linear', 'Outline' ``` -------------------------------- ### Using Composition API with useSolar Hook Source: https://solar-icons.vercel.app/docs/packages/nuxt Demonstrates how to access and modify Solar Icon configurations at runtime using the `useSolar` Composition API hook. This allows dynamic changes to icon properties like size. ```html
``` -------------------------------- ### Global Configuration with SolarProvider Source: https://solar-icons.vercel.app/docs/packages/vue Shows how to apply global styles to all Solar Icons within a Vue application by wrapping components with the SolarProvider. This allows setting default 'size', 'color', and 'weight'. ```vue ``` -------------------------------- ### Configure Global Icon Styles with SolarProvider Source: https://solar-icons.vercel.app/docs/advanced/global-configuration Demonstrates how to wrap a React component tree with SolarProvider to apply default icon properties like size, color, and weight. Icons within the provider inherit these styles unless explicitly overridden. ```javascript import { SolarProvider } from '@solar-icons/react' import { Home, Settings, User } from '@solar-icons/react' export default function App() { return (
) } function Header() { return ( ) } function MainContent() { return } ``` -------------------------------- ### Composition API for Icon Configuration Source: https://solar-icons.vercel.app/docs/packages/vue Demonstrates using the Composition API with `useSolar` to access and dynamically modify icon configurations. This allows for reactive changes to icon properties like size. ```vue ``` -------------------------------- ### Creating Custom Icons with IconBase in Svelte Source: https://solar-icons.vercel.app/docs/packages/svelte Shows how to use the `IconBase` component from `@solar-icons/svelte` to create custom SVG icons. This component accepts standard icon props like size and color. ```svelte ``` -------------------------------- ### Usage: Manual Icon Import via Aliases in Nuxt Source: https://solar-icons.vercel.app/docs/packages/nuxt Shows how to manually import Solar icons using provided aliases in your Nuxt templates and script. This offers more granular control over icon imports and usage. ```html ``` -------------------------------- ### Basic Icon Usage in React Source: https://solar-icons.vercel.app/docs/packages/react Demonstrates how to import and use a Solar Icon component within a React application. Icons can be customized with props like 'weight', 'color', and 'size'. ```jsx import { Home } from '@solar-icons/react' function App() { return } ``` -------------------------------- ### TypeScript Integration with @solar-icons/svelte Source: https://solar-icons.vercel.app/docs/packages/svelte Demonstrates how to import TypeScript types for icon props and styles from the main `@solar-icons/svelte` package. This ensures type safety in your Svelte projects. ```typescript ``` -------------------------------- ### Importing Icons by Category in Svelte Source: https://solar-icons.vercel.app/docs/packages/svelte Illustrates importing icons based on their category (e.g., 'arrows') in Svelte. This approach allows importing all icons within a category for a given style. ```svelte ``` -------------------------------- ### Access Icon Context with useSolar Hook Source: https://solar-icons.vercel.app/docs/advanced/global-configuration Shows how to use the useSolar hook to access and update the current icon configuration context dynamically. This is useful for implementing features like theme toggling. ```javascript import { useSolar } from '@solar-icons/react' import { Sun, Moon } from '@solar-icons/react' function ThemeToggle() { const { value, setValue } = useSolar() const toggleTheme = () => { const newWeight = value.weight === 'Bold' ? 'Linear' : 'Bold' setValue({ weight: newWeight }) } return ( ) } ``` -------------------------------- ### Import Icons by Style Path in React Source: https://solar-icons.vercel.app/docs/packages/react-perf Shows an alternative method for importing Solar Icons from @solar-icons/react-perf by specifying the style in the import path. This approach allows importing the base icon name and is useful for cleaner code organization. ```jsx import { Home } from '@solar-icons/react-perf/bold' import { Settings } from '@solar-icons/react-perf/linear' function App() { return (
) } ``` -------------------------------- ### Basic Icon Usage in Vue Source: https://solar-icons.vercel.app/docs/packages/vue Demonstrates how to import and use a Solar Icon component within a Vue template. Icons can be customized with props like 'weight', 'color', and 'size'. ```vue ``` -------------------------------- ### Category-Based Icon Imports in React Source: https://solar-icons.vercel.app/docs/packages/react Shows how to import all icons from a specific category as a single object in React. This allows for importing multiple icons from a category efficiently. ```jsx import { Arrows } from '@solar-icons/react/category' function App() { return (
) } ``` -------------------------------- ### Import and Use Icons in React Source: https://solar-icons.vercel.app/docs/packages/react-perf Demonstrates how to import and use Solar Icon components from the @solar-icons/react-perf package in a React application. Icons are imported by their combined name and style, and accept props like color and size. ```jsx import { HomeBold, SettingsLinear } from '@solar-icons/react-perf' function App() { return (
) } ``` -------------------------------- ### Category Imports for Solar Icons Source: https://solar-icons.vercel.app/docs/packages/vue Shows how to import all icons from a specific category (e.g., 'Arrows') as a single object. This simplifies importing multiple related icons. ```vue ``` -------------------------------- ### Usage: Auto-imported Solar Icons in Nuxt Template Source: https://solar-icons.vercel.app/docs/packages/nuxt Demonstrates how to use Solar icons directly as components in your Nuxt templates when auto-import is enabled. You can pass props like size, weight, and color to customize individual icons. ```html ``` -------------------------------- ### Using Solar Icons with CSS in Svelte Source: https://solar-icons.vercel.app/docs/packages/svelte Explains how Solar Icons can inherit text color from their parent elements when using CSS, leveraging the default `currentColor` prop. This allows for easy theming. ```svelte
``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.