### Full Integration Example Source: https://context7.com/rainxchzed/rikkaicons/llms.txt An end-to-end example demonstrating icon setup, pack provision, rendering, fallback chains, custom packs, and coverage enforcement within an application. ```kotlin // App.kt — entry point @Composable fun App() { // Material Symbols as primary pack, Lucide as fallback for any gaps val msPack = rememberMaterialSymbolsPack( variant = MaterialSymbolsVariant.Outlined, weight = 400, opticalSize = 24f, ) val iconPack = msPack.withFallback(LucidePack) ProvideIconPack(iconPack) { AppTheme { MainScreen() } } } ``` ```kotlin // MainScreen.kt — using icons @Composable fun MainScreen() { Column { // Semantic icon — pack decided at provision site AppIcon(RikkaIcons.Home, contentDescription = "Home") // Explicit pack override AppIcon( token = RikkaIcons.Star, contentDescription = "Favorite", pack = PhosphorPack.Fill, tint = Color(0xFFFFD700), size = 32.dp, ) // RTL-aware navigation icon AppIcon(RikkaIcons.ArrowLeft, contentDescription = "Back") // Extended token AppIcon(RikkaIconsExtended.Fingerprint, contentDescription = "Biometric login") // Loose token — explicit pack required ProvideIconPack(LucidePack) { AppIcon(RikkaIconsLoose.Lucide.WandSparkles, contentDescription = "AI feature") } // Decorative DecorativeAppIcon(token = RikkaIcons.Flame, tint = Color.Red) } } ``` ```kotlin // CustomPack.kt — app-specific icons with Lucide fallback val MyAppIconPack: IconPack = buildIconPack("my-app", IconStyle.Outline) { register(IconToken("brand-logo")) { IconRendition.Vector(BrandLogoVector) } register(IconToken("feature-ai")) { IconRendition.Vector(AiFeatureVector) } fallbackTo(LucidePack) } ``` -------------------------------- ### Icon Pack Initialization Examples Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Demonstrates how to initialize different types of icon packs. Vector packs are singletons, while Material Symbols is a composable factory due to its dynamic font loading capabilities. ```kotlin // Vector packs — singletons, use directly LucidePack TablerPack.Outline / .Filled PhosphorPack.Regular / .Bold / .Fill BootstrapPack.Outline / .Filled ``` ```kotlin // Material Symbols — composable factory (loads variable font) rememberMaterialSymbolsPack() rememberMaterialSymbolsPack(MaterialSymbolsVariant.Filled) rememberMaterialSymbolsPack(MaterialSymbolsVariant.Rounded, weight = 700) ``` -------------------------------- ### Icon Coverage Testing Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Code examples for testing icon pack coverage using `IconPackValidator`. These tests can be used in CI to enforce icon resolution and identify missing tokens. ```kotlin // CoverageTest.kt — CI enforcement class IconCoverageTest { @Test fun `LucidePack covers all core tokens`() { IconPackValidator.enforce(LucidePack, RikkaIcons.all) } @Test fun `MyAppIconPack covers core tokens via fallback`() { val report = IconPackValidator.validate(MyAppIconPack, RikkaIcons.all) println(report.summary()) // → "IconPackValidator: my-app+lucide — 229/229 tokens resolved (100%)" assert(report.isFullCoverage) } @Test fun `TablerPack covers extended tokens`() { val report = IconPackValidator.validate(TablerPack.Outline, RikkaIconsExtended.all) println("Tabler extended coverage: ${report.coveragePercent.toInt()}%") println("Missing: ${report.missingTokens.map { it.name }}") } } ``` -------------------------------- ### Run Showcase App Source: https://github.com/rainxchzed/rikkaicons/blob/main/README.md Command to run the showcase web application using Gradle. ```bash ./gradlew :composeApp:wasmJsBrowserDevelopmentRun ``` -------------------------------- ### Showcase App Architecture Overview Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Provides a high-level overview of the showcase app's architecture, highlighting the use of Navigation 3, MVI pattern per screen, and event handling via Channels. ```kotlin - **Navigation 3** (`org.jetbrains.androidx.navigation3:navigation3-ui:1.0.0-alpha06`) with polymorphic serialization for non-JVM targets - **MVI per screen** — each screen has its own `State`, `Action`, `Event`, `ViewModel`, `Root`, and `Screen` composable - **Root/Screen separation** — Root holds ViewModel + observes events; Screen is pure `(state, onAction)` composable - **Events via Channel** — one-shot events (navigation) flow through `Channel` → `receiveAsFlow()`, observed in Root via `ObserveAsEvents` ``` -------------------------------- ### Run All Tests Source: https://github.com/rainxchzed/rikkaicons/blob/main/README.md Command to execute all tests in the project using Gradle. ```bash ./gradlew allTests ``` -------------------------------- ### Responsive Layout with BoxWithConstraints Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Demonstrates how to implement responsive layouts in Jetpack Compose using `BoxWithConstraints` and `WindowWidthClass` to adapt UI elements based on screen width. ```kotlin Uses `BoxWithConstraints` → `WindowWidthClass` with three breakpoints: | Class | Width | Icon List Layout | Detail Layout | |-------|-------|-----------------|---------------| | Compact | <600dp | No sidebar, horizontal scroll chips, 16dp padding | Stacked hero cards, 16dp padding | | Medium | 600-839dp | No sidebar, inline chips, 24dp padding | Side-by-side hero, 24dp padding | | Expanded | ≥840dp | Full sidebar + grid, 48dp padding | Side-by-side hero, 48dp padding | ``` -------------------------------- ### Showcase App Structure Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Details the directory structure and key files within the showcase app, outlining the organization of navigation, screens, components, data, and utilities. ```kotlin showcase/ ShowcaseNavHost.kt — Nav3 host, ProvideIconPack, route→screen wiring navigation/ NavKeys.kt — @Serializable route definitions (IconListRoute, IconDetailRoute) NavConfig.kt — SavedStateConfiguration with polymorphic SerializersModule list/ IconListState.kt — data class (searchQuery, selectedCategory, selectedVariant, filteredIcons) IconListAction.kt — sealed interface (OnSearchQueryChange, OnCategorySelected, OnVariantSelected, OnIconClick) IconListEvent.kt — sealed interface (NavigateToDetail) IconListViewModel.kt — owns filtering logic, emits nav events IconListScreen.kt — Root + Screen with responsive layouts (Compact/Medium/Expanded) detail/ IconDetailState.kt — data class (icon, propertyName, variantId, packCoverage) IconDetailAction.kt — sealed interface (OnMsPackReady, OnBackClick) IconDetailEvent.kt — sealed interface (NavigateBack) IconDetailViewModel.kt — resolves pack coverage, derives property name IconDetailScreen.kt — Root + Screen with responsive hero section components/ IconGrid.kt — LazyVerticalStaggeredGrid with FullLine header span, responsive horizontalPadding SearchBar.kt — search input with result count VariantPicker.kt — FlowRow of Buttons for MS variant selection data/ IconCatalog.kt — icon catalog + categories + index PackInfo.kt — vector pack list + tokenToPropertyName utility VariantOptions.kt — MaterialSymbolsVariant label/value pairs util/ WindowSize.kt — WindowWidthClass enum + breakpoints (Compact <600, Medium 600-839, Expanded ≥840) ObserveAsEvents.kt — LaunchedEffect-based event observation ``` -------------------------------- ### Providing Icon Packs with ProvideIconPack Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Shows how to provide an icon pack to the composition using ProvideIconPack. This makes the specified pack available to descendant composables. ```kotlin ProvideIconPack(LucidePack) { App() } ``` -------------------------------- ### Rendering Icons with AppIcon and DecorativeAppIcon Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Demonstrates rendering icons using AppIcon for accessible content and DecorativeAppIcon for non-accessible content. AppIcon takes a token and content description, with an optional pack override. DecorativeAppIcon only requires a token. ```kotlin AppIcon(token = RikkaIcons.Heart, contentDescription = "Like") ``` ```kotlin AppIcon(token = RikkaIcons.Search, contentDescription = "Search", pack = LucidePack) ``` ```kotlin DecorativeAppIcon(token = RikkaIcons.Star) ``` -------------------------------- ### Basic AppIcon Usage Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Render an icon using the ambient `LocalIconPack`. Ensure the `token` and `contentDescription` are provided. ```kotlin // Basic usage with ambient pack AppIcon( token = RikkaIcons.Heart, contentDescription = "Like", ) ``` -------------------------------- ### ProvideIconPack for Application Root Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Set the active IconPack for the entire application at the root level. Use `LucidePack` for vector icons. ```kotlin // At your application root — vector pack @Composable fun App() { ProvideIconPack(LucidePack) { MainContent() } } ``` -------------------------------- ### Providing Icons Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Use the `ProvideIconPack` composable to make an icon pack available in the composition. ```APIDOC ## Providing Icons ### `ProvideIconPack` ```kotlin ProvideIconPack(LucidePack) { App() } ``` This composable makes the specified `IconPack` available to its descendants via `LocalIconPack`. ``` -------------------------------- ### Provide and Use Icons in Compose Source: https://github.com/rainxchzed/rikkaicons/blob/main/README.md Wrap your app with ProvideIconPack and use AppIcon to render icons. The pack is automatically read from LocalIconPack. ```kotlin // Provide a pack at the root ProvideIconPack(LucidePack) { App() } // Use icons anywhere @Composable fun LikeButton() { AppIcon( token = RikkaIcons.Heart, contentDescription = "Like", ) } ``` ```kotlin // Vector packs — just use the object directly ProvideIconPack(LucidePack) { App() } // Packs with style variants ProvideIconPack(TablerPack.Outline) { ... } ProvideIconPack(PhosphorPack.Regular) { ... } ProvideIconPack(BootstrapPack.Filled) { ... } // Material Symbols — composable factory (loads variable font) ProvideIconPack(rememberMaterialSymbolsPack()) { ... } ProvideIconPack(rememberMaterialSymbolsPack(MaterialSymbolsVariant.Rounded)) { ... } ``` ```kotlin // Reads the pack from LocalIconPack automatically AppIcon( token = RikkaIcons.Heart, contentDescription = "Like", ) // Override per-icon if needed AppIcon( token = RikkaIcons.Search, contentDescription = "Search", pack = LucidePack, ) // Decorative (no accessibility semantics) DecorativeAppIcon(token = RikkaIcons.Star) ``` -------------------------------- ### Icon Pack Initialization Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Initialize vector-based icon packs directly as they are singletons. Material Symbols packs are composable factories due to their dynamic nature. ```APIDOC ## Icon Pack Initialization ### Vector Packs ```kotlin // Vector packs — singletons, use directly LucidePack TablerPack.Outline / .Filled PhosphorPack.Regular / .Bold / .Fill BootstrapPack.Outline / .Filled ``` ### Material Symbols Packs ```kotlin // Material Symbols — composable factory (loads variable font) rememberMaterialSymbolsPack() rememberMaterialSymbolsPack(MaterialSymbolsVariant.Filled) rememberMaterialSymbolsPack(MaterialSymbolsVariant.Rounded, weight = 700) ``` **Note:** Vector packs are objects. Material Symbols is the only `@Composable` factory because it loads a font resource with configurable axes (weight, grade, opticalSize, fill). ``` -------------------------------- ### Publish Modules to Local Maven Source: https://github.com/rainxchzed/rikkaicons/blob/main/README.md Command to publish all modules to the local Maven repository using Gradle. Disables configuration cache and signing for release. ```bash ./gradlew publishToMavenLocal --no-configuration-cache -PRELEASE_SIGNING_ENABLED=false ``` -------------------------------- ### Build Custom Icon Pack with DSL Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Use the buildIconPack DSL to create custom IconPack implementations. This is useful for app-specific icons or bridging existing icon sets. Rendition lambdas are lazy and only called when resolved. ```kotlin // fun buildIconPack( // id: String, // style: IconStyle = IconStyle.Outline, // block: IconPackBuilder.() -> Unit, // ): IconPack // Custom pack with two brand icons that falls back to Lucide for everything else val MyAppPack = buildIconPack("my-app", IconStyle.Outline) { register(IconToken("brand-logo")) { IconRendition.Vector(BrandLogoVector) } register(IconToken("special-feature")) { IconRendition.Vector(SpecialFeatureVector) } fallbackTo(LucidePack) } // Usage ProvideIconPack(MyAppPack) { AppIcon(IconToken("brand-logo"), contentDescription = "App Logo") // custom AppIcon(RikkaIcons.Search, contentDescription = "Search") // from Lucide fallback } // Rendition lambdas are lazy — called on each resolve(), not cached val lazyPack = buildIconPack("lazy") { register(RikkaIcons.Heart) { IconRendition.Vector(expensivelyLoadedVector()) // called only when resolved } } // Override a token by registering it twice — last wins val overridePack = buildIconPack("override") { register(RikkaIcons.Star) { IconRendition.Vector(outlineStarVector) } register(RikkaIcons.Star) { IconRendition.Vector(filledStarVector) } // this wins } ``` -------------------------------- ### Python Script for Adding Pack Synonyms Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script adds synonym entries to icon pack mapping files. ```python add_pack_synonyms.py ``` -------------------------------- ### Accessing RikkaIcons Tokens Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Demonstrates how to access different icon tokens from various RikkaIcons modules. Ensure the respective modules are included in your project. ```kotlin RikkaIcons.Heart // from :tokens-core (229 stable tokens) RikkaIcons.Search RikkaIcons.ArrowLeft // autoMirror = true for RTL RikkaIconsExtended.Palette // from :tokens-extended (238 tokens, MS + ≥3 of 4 vector packs) RikkaIconsLoose.Lucide.WholeWord // from :tokens-loose (341 tokens, MS + 1-2 vector packs) RikkaIconsLoose.Tabler.Forklift // pack dependency explicit at call site RikkaIconsLoose.Phosphor.Stethoscope RikkaIconsLoose.Bootstrap.Bandaid ``` -------------------------------- ### AppIcon with Custom Size and Tint Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Customize the appearance of an `AppIcon` by specifying its `size` in `Dp` and `tint` color. ```kotlin // Custom size and tint AppIcon( token = RikkaIcons.AlertCircle, contentDescription = "Warning", tint = Color.Red, size = 32.dp, ) ``` -------------------------------- ### Rendering Icons Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Render icons using `AppIcon` for accessible icons or `DecorativeAppIcon` for non-accessible decorative icons. ```APIDOC ## Rendering Icons ### `AppIcon` ```kotlin AppIcon(token = RikkaIcons.Heart, contentDescription = "Like") AppIcon(token = RikkaIcons.Search, contentDescription = "Search", pack = LucidePack) ``` `AppIcon` renders an icon with accessibility semantics. It takes an `IconToken` and an optional `contentDescription`. You can also override the `pack` used for resolution. ### `DecorativeAppIcon` ```kotlin DecorativeAppIcon(token = RikkaIcons.Star) ``` `DecorativeAppIcon` renders an icon without accessibility semantics, suitable for purely decorative elements. ``` -------------------------------- ### IconPack Interface and Built-in Packs Source: https://context7.com/rainxchzed/rikkaicons/llms.txt IconPack maps IconTokens to IconRenditions. Inspect built-in packs like LucidePack, TablerPack, PhosphorPack, BootstrapPack, and Material Symbols packs to understand their IDs and styles. ```kotlin // interface IconPack { // val id: String // val style: IconStyle // default: IconStyle.Outline // fun resolve(token: IconToken): IconRendition? // } // Built-in packs — vector packs are singletons, used directly LucidePack // id = "lucide", style = Outline TablerPack.Outline // id = "tabler-outline" TablerPack.Filled // id = "tabler-filled", style = Filled PhosphorPack.Regular // id = "phosphor-regular" PhosphorPack.Bold // id = "phosphor-bold" PhosphorPack.Fill // id = "phosphor-fill", style = Filled BootstrapPack.Outline // id = "bootstrap-outline" BootstrapPack.Filled // id = "bootstrap-filled", style = Filled // Inspect a pack println(LucidePack.id) // "lucide" println(LucidePack.style) // IconStyle.Outline println(LucidePack.resolve(RikkaIcons.Heart)) // IconRendition.Vector(...) println(LucidePack.resolve(IconToken("nonexistent"))) // null ``` -------------------------------- ### Python Script for Regenerating Material Symbols Files Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script regenerates the `MaterialSymbolsMapping.kt` and `MaterialSymbolsCodepoints.kt` files. ```python regenerate_ms_files.py ``` -------------------------------- ### Add RikkaIcons Dependencies Source: https://github.com/rainxchzed/rikkaicons/blob/main/README.md Include the core, tokens, and desired icon pack dependencies in your build.gradle.kts file. ```kotlin // build.gradle.kts dependencies { implementation("dev.rikkaui.icons:core:0.1.0") implementation("dev.rikkaui.icons:tokens-core:0.1.0") implementation("dev.rikkaui.icons:pack-lucide:0.1.0") } ``` ```kotlin // build.gradle.kts dependencies { // Core (required) implementation("dev.rikkaui.icons:core:0.1.0") implementation("dev.rikkaui.icons:tokens-core:0.1.0") // Extended tokens (optional — 238 extra tokens with broad pack coverage) implementation("dev.rikkaui.icons:tokens-extended:0.1.0") // Loose tokens (optional — 341 pack-specific tokens) implementation("dev.rikkaui.icons:tokens-loose:0.1.0") // Pick one (or more) icon packs implementation("dev.rikkaui.icons:pack-lucide:0.1.0") implementation("dev.rikkaui.icons:pack-tabler:0.1.0") implementation("dev.rikkaui.icons:pack-phosphor:0.1.0") implementation("dev.rikkaui.icons:pack-bootstrap:0.1.0") implementation("dev.rikkaui.icons:pack-material-symbols:0.1.0") implementation("dev.rikkaui.icons:pack-material-symbols-rounded:0.1.0") implementation("dev.rikkaui.icons:pack-material-symbols-sharp:0.1.0") } ``` -------------------------------- ### DecorativeAppIcon for Ornamental Icons Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Render purely decorative icons without accessibility semantics using `DecorativeAppIcon`. Specify `token`, `tint`, and `size` as needed. ```kotlin // Ornamental divider icon — no content description needed DecorativeAppIcon( token = RikkaIcons.Star, tint = Color(0xFFFFD700), size = 16.dp, ) ``` -------------------------------- ### Python Script for Generating Lucide Icon Pack Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script converts Lucide SVGs into ImageVector Kotlin files and creates corresponding mappings. ```python generate_lucide_pack.py ``` -------------------------------- ### Material Symbols Resolution Chain Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Illustrates the process of resolving an icon token to its final rendition, showing the mapping, codepoint lookup, and glyph creation steps. ```kotlin IconToken("heart") → materialSymbolsMapping["heart"] → "favorite" (curated, hand-mapped) → materialSymbolsCodepoints["favorite"] → '\uEF4E' (generated from Google's data) → IconRendition.Glyph('\uEF4E', fontFamily) ``` -------------------------------- ### Checking for Style Mismatch in Chained Packs Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Use `withFallback` to chain icon packs and check for `hasStyleMismatch` to identify potential visual inconsistencies between packs. ```kotlin // Check for mismatch before chaining val primary = TablerPack.Outline // Outline val fallback = TablerPack.Filled // Filled // Mixing these will print a debug warning ⚠️ val chained = primary.withFallback(fallback) if ((chained as? FallbackIconPack)?.hasStyleMismatch == true) { println("Warning: pack styles differ — icons may look inconsistent") } ``` -------------------------------- ### ProvideIconPack with Material Symbols Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Use `rememberMaterialSymbolsPack()` to provide Material Symbols icons, which requires a `@Composable` function due to font resource loading. ```kotlin // Material Symbols — must be @Composable because it loads a font resource @Composable fun App() { ProvideIconPack(rememberMaterialSymbolsPack()) { MainContent() } } ``` -------------------------------- ### Core Abstractions in RikkaIcons Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Illustrates the core abstractions: IconToken for semantic names, IconPack for mapping tokens to renditions, and AppIcon for rendering. IconToken has a name and an optional autoMirror property. IconPack is an interface with resolve, id, and style. IconRendition is a sealed class for Glyph or Vector. IconStyle is an enum. ```kotlin IconToken("heart") — semantic name, no visual form ↓ resolve() IconPack (LucidePack) — maps tokens to renditions ↓ IconRendition.Vector(iv) — or IconRendition.Glyph(char, font) ↓ AppIcon(token, ...) — composable that renders it ``` -------------------------------- ### Fallback Icon Pack Chains Source: https://github.com/rainxchzed/rikkaicons/blob/main/README.md Configure a chain of icon packs to provide fallback options if an icon is not found in the primary pack. ```kotlin val icons = TablerPack.Outline.withFallback(LucidePack) ProvideIconPack(icons) { // tries Tabler first, then Lucide AppIcon(token = RikkaIcons.Heart, contentDescription = "Like") } ``` -------------------------------- ### Create Fallback Icon Pack Chain Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Chain multiple icon packs to provide a fallback mechanism. Tokens missing in the primary pack will be sought in the fallback pack. Debug warnings are printed if packs have different IconStyles. ```kotlin // class FallbackIconPack(val primary: IconPack, val fallback: IconPack) : IconPack // fun IconPack.withFallback(fallback: IconPack): IconPack // Basic fallback chain: try Tabler first, then Lucide val icons = TablerPack.Outline.withFallback(LucidePack) ProvideIconPack(icons) { AppIcon(RikkaIcons.Heart, contentDescription = "Like") // resolved from TablerPack or LucidePack } // Triple chain: custom → Lucide → Material Symbols val fullCoverage = myCustomPack .withFallback(LucidePack) .withFallback(rememberMaterialSymbolsPack()) // The composed ID reflects the chain println(icons.id) // "tabler-outline+lucide" // FallbackIconPack exposes both packs and mismatch flag val fb = FallbackIconPack(TablerPack.Outline, LucidePack) println(fb.primary.id) // "tabler-outline" println(fb.fallback.id) // "lucide" println(fb.hasStyleMismatch) // false (both Outline) ``` -------------------------------- ### Python Script for Generating Phosphor Icon Pack Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script converts Phosphor Icons SVGs (regular, bold, fill) into ImageVector Kotlin files and generates mappings. It uses a 256x256 viewport. ```python generate_phosphor_pack.py ``` -------------------------------- ### Python Script for Auditing Pack Synonyms Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script identifies name synonyms across different icon packs, focusing on borderline tokens. ```python audit_pack_synonyms.py ``` -------------------------------- ### Custom Glyph Rendition Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Create a custom `IconRendition.Glyph` for font-based icon packs. Specify the character, `FontFamily`, and optionally adjust `opticalScale` for visual weight. ```kotlin // Custom glyph rendition for a font-based custom pack val myGlyph = IconRendition.Glyph( char = '\uE001', fontFamily = myCustomFontFamily, opticalScale = 1.1f, // slightly larger to match visual weight of other packs ) ``` -------------------------------- ### Python Script for Generating Bootstrap Icon Pack Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script converts Bootstrap Icons SVGs (outline and filled) into ImageVector Kotlin files and generates mappings. It uses a 16x16 viewport. ```python generate_bootstrap_pack.py ``` -------------------------------- ### AppIcon for RTL Mirroring Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Use `AppIcon` with tokens that have `autoMirror = true` (like `ArrowLeft`) to automatically flip the icon in Right-to-Left layouts. ```kotlin // RTL-aware: ArrowLeft has autoMirror = true, so it flips in RTL layouts AppIcon( token = RikkaIcons.ArrowLeft, contentDescription = "Go back", ) ``` -------------------------------- ### Accessing IconPack Style Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Retrieve the `IconStyle` (e.g., Outline, Filled) of an `IconPack` to understand its visual category. ```kotlin println(LucidePack.style) // IconStyle.Outline println(TablerPack.Filled.style) // IconStyle.Filled ``` -------------------------------- ### Material Symbols Font Axes Configuration Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Explains the parameters for `rememberMaterialSymbolsPack` to customize Material Symbols, including weight, grade, and optical size. The 'fill' property is automatically derived. ```kotlin `rememberMaterialSymbolsPack(variant, weight, grade, opticalSize)`: - **weight**: 100–700 (default 400). Stroke weight. - **grade**: -25–200 (default 0). Fine weight adjustment without layout change. - **opticalSize**: 20–48 (default 24). Should match AppIcon `size` param. - **fill**: Derived from `variant.iconStyle` automatically. Not a parameter. ``` -------------------------------- ### Python Script for Generating Kotlin Token Definitions Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script is used to convert JSON data into Kotlin token definitions and generate Material Symbols mappings. ```python generate_tokens.py ``` -------------------------------- ### Gradle Dependencies for RikkaIcons Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Add the core RikkaIcons library, token modules, and desired icon packs to your project's Gradle dependencies. Ensure you select at least one token tier and one icon pack. ```kotlin // build.gradle.kts dependencies { // Required implementation("dev.rikkaui.icons:core:0.1.0") implementation("dev.rikkaui.icons:tokens-core:0.1.0") // Optional token tiers implementation("dev.rikkaui.icons:tokens-extended:0.1.0") implementation("dev.rikkaui.icons:tokens-loose:0.1.0") // Choose one or more icon packs implementation("dev.rikkaui.icons:pack-lucide:0.1.0") implementation("dev.rikkaui.icons:pack-tabler:0.1.0") implementation("dev.rikkaui.icons:pack-phosphor:0.1.0") implementation("dev.rikkaui.icons:pack-bootstrap:0.1.0") implementation("dev.rikkaui.icons:pack-material-symbols:0.1.0") implementation("dev.rikkaui.icons:pack-material-symbols-rounded:0.1.0") // +Rounded/FilledRounded implementation("dev.rikkaui.icons:pack-material-symbols-sharp:0.1.0") // +Sharp/FilledSharp } ``` -------------------------------- ### Python Script for Generating Tabler Icon Pack Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script converts Tabler Icons SVGs (outline and filled) into ImageVector Kotlin files and generates mappings. ```python generate_tabler_pack.py ``` -------------------------------- ### RikkaIcons Token Tiers Source: https://github.com/rainxchzed/rikkaicons/blob/main/README.md Understand the three tiers of tokens: Core (universal), Extended (broad coverage), and Loose (pack-specific). ```kotlin // Core — universal, works everywhere RikkaIcons.Heart RikkaIcons.Search RikkaIcons.ArrowLeft // autoMirror = true for RTL // Extended — broad coverage across packs RikkaIconsExtended.Palette // Loose — pack-specific, dependency explicit at call site RikkaIconsLoose.Lucide.WholeWord RikkaIconsLoose.Tabler.Forklift RikkaIconsLoose.Phosphor.Stethoscope RikkaIconsLoose.Bootstrap.Bandaid ``` -------------------------------- ### Python Script for Expanding Material Symbols Mapping Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script automatically matches token names to Material Symbols icon names by extracting font information. ```python expand_ms_mapping.py ``` -------------------------------- ### DecorativeAppIcon in a Row Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Use `DecorativeAppIcon` within layouts like `Row` for purely visual elements, such as a series of stars in a rating display. ```kotlin // In a rating row of decorative stars Row { repeat(5) { DecorativeAppIcon(token = RikkaIcons.Star) } } ``` -------------------------------- ### Remember Material Symbols Pack Composable Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Use `rememberMaterialSymbolsPack` to load and configure the Material Symbols variable font pack at runtime. It requires a composable call to set up the font resource and variable axes. Different variants and weights can be specified. ```kotlin // @Composable // fun rememberMaterialSymbolsPack( // variant: MaterialSymbolsVariant = MaterialSymbolsVariant.Outlined, // weight: Int = 400, // 100–700 // grade: Float = 0f, // -25–200 // opticalSize: Float = 24f, // 20–48 — match AppIcon size param // ): MaterialSymbolsPack // Default — Outlined, weight 400 ProvideIconPack(rememberMaterialSymbolsPack()) { App() } ``` ```kotlin // Filled variant ProvideIconPack(rememberMaterialSymbolsPack(MaterialSymbolsVariant.Filled)) { App() } ``` ```kotlin // Bold weight, adjusted for larger icons ProvideIconPack( rememberMaterialSymbolsPack( variant = MaterialSymbolsVariant.Outlined, weight = 700, opticalSize = 48f, // match AppIcon size = 48.dp ) ) { App() } ``` ```kotlin // Rounded variant (requires :pack-material-symbols-rounded) ProvideIconPack(rememberMaterialSymbolsPack(MaterialSymbolsVariant.Rounded)) { App() } ``` ```kotlin // Sharp filled (requires :pack-material-symbols-sharp) ProvideIconPack( rememberMaterialSymbolsPack( variant = MaterialSymbolsVariant.FilledSharp, weight = 300, grade = -25f, ) ) { App() } ``` ```kotlin // Dynamic variant switching (e.g., driven by ViewModel state) @Composable fun App(viewModel: ShowcaseViewModel) { val variant by viewModel.selectedVariant.collectAsState() val pack = rememberMaterialSymbolsPack(variant) ProvideIconPack(pack) { ShowcaseContent() } } ``` -------------------------------- ### Custom Vector Rendition Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Define a custom `IconRendition.Vector` by providing an `ImageVector`. ```kotlin // Custom vector rendition val myVector = IconRendition.Vector(imageVector = myImageVector) ``` -------------------------------- ### Inspecting Icon Rendition Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Determine the type of `IconRendition` (Vector or Glyph) resolved by an `IconPack` for a given token. Handles cases where the token might not be found. ```kotlin // Inspect what a pack resolves for a token when (val rendition = LucidePack.resolve(RikkaIcons.Heart)) { is IconRendition.Vector -> println("SVG vector: ${rendition.imageVector}") is IconRendition.Glyph -> println("Font glyph: ${rendition.char}, scale: ${rendition.opticalScale}") null -> println("Token not found in this pack") } ``` -------------------------------- ### AppIcon with Per-Icon Pack Override Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Specify a `pack` directly on `AppIcon` to use a different icon pack for a single icon, overriding the ambient `LocalIconPack`. ```kotlin // Per-icon pack override (ignores ambient LocalIconPack for this icon) AppIcon( token = RikkaIcons.Search, contentDescription = "Search", pack = LucidePack, ) ``` -------------------------------- ### Python Script for Restructuring Extended Tokens Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script splits tokens into extended (Material Symbols + 3+ vector packs) and loose (Material Symbols + 1-2 vector packs) categories. ```python restructure_extended_tokens.py ``` -------------------------------- ### Nested ProvideIconPack Override Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Override the active IconPack for a specific subtree of composables. This allows different sections of your UI to use different icon sets. ```kotlin // Nested override: a subtree uses a different pack @Composable fun FilledSection() { ProvideIconPack(TablerPack.Filled) { // All AppIcon calls here use TablerPack.Filled AppIcon(RikkaIcons.Star, contentDescription = "Favorite") } } ``` -------------------------------- ### Validate Icon Pack Coverage Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Use IconPackValidator to check if an icon pack resolves all specified tokens. `validate()` returns a report, while `enforce()` throws a CoverageException for any missing tokens. This is ideal for catching coverage regressions in tests. ```kotlin // object IconPackValidator { // fun validate(pack: IconPack, tokens: List): Report // fun enforce(pack: IconPack, tokens: List) // // data class Report( // val packId: String, // val totalTokens: Int, // val resolvedTokens: Int, // val missingTokens: List, // val coveragePercent: Float, // val isFullCoverage: Boolean, // ) { fun summary(): String } // // class CoverageException(val report: Report) : IllegalStateException // } // Soft validation — log coverage report val report = IconPackValidator.validate(LucidePack, RikkaIcons.all) println(report.summary()) // → "IconPackValidator: lucide — 229/229 tokens resolved (100% coverage)" // Inspect the report println(report.isFullCoverage) // true println(report.coveragePercent) // 100.0 println(report.missingTokens) // [] // Partial coverage report val partialReport = IconPackValidator.validate(myPartialPack, RikkaIcons.all) if (!partialReport.isFullCoverage) { println("Missing: ${partialReport.missingTokens.map { it.name }}") } // Hard enforcement — throws CoverageException if any tokens are unresolved // Ideal inside unit tests: @Test fun `LucidePack covers all core tokens`() { IconPackValidator.enforce(LucidePack, RikkaIcons.all) // no exception = pass } @Test fun `custom pack covers required tokens`() { try { IconPackValidator.enforce(MyAppPack, RikkaIcons.all) } catch (e: IconPackValidator.CoverageException) { println("Coverage: ${e.report.coveragePercent}%") println("Missing: ${e.report.missingTokens.map { it.name }}") // → e.g. "Missing: [brand-logo, special-feature]" for gaps not in Lucide } } ``` -------------------------------- ### RikkaIcons Core Tokens Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Access canonical icon tokens from `RikkaIcons` for use across various icon packs. Tokens are globally unique and organized by category. The `all` property provides a list of all core tokens, useful for validation. ```kotlin // Tokens are accessed as properties on RikkaIcons RikkaIcons.Heart // IconToken("heart") RikkaIcons.Search // IconToken("search") RikkaIcons.ArrowLeft // IconToken("arrow-left", autoMirror = true) RikkaIcons.Settings // IconToken("settings") ``` ```kotlin // Enumerate all core tokens val allCoreTokens: List = RikkaIcons.all // 229 tokens ``` ```kotlin // Use in a validator test @Test fun `my pack covers all core icons`() { IconPackValidator.enforce(MyCustomPack, RikkaIcons.all) } ``` ```kotlin // Sample tokens by category RikkaIcons.Plus // Actions RikkaIcons.Mail // Communication RikkaIcons.Play // Media RikkaIcons.Folder // Files & Data RikkaIcons.Star // Status RikkaIcons.MapPin // Maps & Location RikkaIcons.ShoppingCart // Commerce RikkaIcons.Calendar // Weather & Time RikkaIcons.Wifi // Miscellaneous RikkaIcons.Grid // Layout & UI RikkaIcons.User // User & Social RikkaIcons.Sun // Weather ``` -------------------------------- ### Reading LocalIconPack Current Value Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Access the current IconPack from `CompositionLocal` to manually resolve icon renditions within a composable. ```kotlin // Read the ambient pack manually @Composable fun CustomIconWidget(token: IconToken) { val pack = LocalIconPack.current val rendition = pack.resolve(token) // ... render rendition manually } ``` -------------------------------- ### RikkaIconsLoose Tokens Source: https://context7.com/rainxchzed/rikkaicons/llms.txt RikkaIconsLoose provides pack-specific tokens that resolve in Material Symbols and 1-2 vector packs. The call site must explicitly declare the pack dependency. ```kotlin // Tokens organized by the vector pack that supports them RikkaIconsLoose.Lucide.WholeWord // Lucide + MS only RikkaIconsLoose.Lucide.LoaderCircle RikkaIconsLoose.Tabler.Forklift // Tabler + MS only RikkaIconsLoose.Tabler.Podium RikkaIconsLoose.Phosphor.Stethoscope // Phosphor + MS only RikkaIconsLoose.Phosphor.CalendarDots RikkaIconsLoose.Bootstrap.Bandaid // Bootstrap + MS only RikkaIconsLoose.Bootstrap.SdCard // Enumerate by pack family val lucideOnlyTokens: List = RikkaIconsLoose.Lucide.all // 244 val tablerOnlyTokens: List = RikkaIconsLoose.Tabler.all // 99 val phosphorTokens: List = RikkaIconsLoose.Phosphor.all // 46 val bootstrapTokens: List = RikkaIconsLoose.Bootstrap.all // 12 // Deduplicated across all four families val allLoose: List = RikkaIconsLoose.all // Must pair with the correct pack or use MS as fallback ProvideIconPack(LucidePack.withFallback(rememberMaterialSymbolsPack())) { AppIcon(RikkaIconsLoose.Lucide.WandSparkles, contentDescription = "Magic") } ``` -------------------------------- ### Material Symbols Variants Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md Lists the available variants for Material Symbols, including default, filled, rounded, and sharp versions. Note that Rounded/Sharp are extension properties. ```kotlin Base module (:pack-material-symbols): MaterialSymbolsVariant.Outlined — default MaterialSymbolsVariant.Filled Rounded module (:pack-material-symbols-rounded): MaterialSymbolsVariant.Rounded MaterialSymbolsVariant.FilledRounded Sharp module (:pack-material-symbols-sharp): MaterialSymbolsVariant.Sharp MaterialSymbolsVariant.FilledSharp Rounded/Sharp are extension properties on `MaterialSymbolsVariant.Companion`. ``` -------------------------------- ### Material Symbols Variant Interface Source: https://context7.com/rainxchzed/rikkaicons/llms.txt The `MaterialSymbolsVariant` interface defines icon shape styles and fill states. Base variants like `Outlined` and `Filled` are provided, with additional rounded and sharp variants available through separate modules. ```kotlin // interface MaterialSymbolsVariant { // val id: String // val fontResource: FontResource // val iconStyle: IconStyle // companion object { val Outlined; val Filled } // } // Base module (:pack-material-symbols) MaterialSymbolsVariant.Outlined // Outline style, unfilled MaterialSymbolsVariant.Filled // Filled style ``` ```kotlin // Rounded module (:pack-material-symbols-rounded) MaterialSymbolsVariant.Rounded // Rounded style, unfilled MaterialSymbolsVariant.FilledRounded // Rounded style, filled ``` ```kotlin // Sharp module (:pack-material-symbols-sharp) MaterialSymbolsVariant.Sharp // Sharp style, unfilled MaterialSymbolsVariant.FilledSharp // Sharp style, filled ``` ```kotlin // Each variant maps to an iconStyle println(MaterialSymbolsVariant.Outlined.iconStyle) // IconStyle.Outline println(MaterialSymbolsVariant.FilledRounded.iconStyle) // IconStyle.Filled ``` -------------------------------- ### Python Script for Subsetting Fonts Source: https://github.com/rainxchzed/rikkaicons/blob/main/CLAUDE.md This Python script subsets Material Symbols TTF fonts to include only used codepoints. It requires the 'fonttools' library. ```python subset_font.py ``` -------------------------------- ### IconToken Definition and Usage Source: https://context7.com/rainxchzed/rikkaicons/llms.txt IconToken represents a semantic icon identifier with an optional autoMirror flag for RTL layouts. Use pre-built tokens or create custom ones for your application. ```kotlin // data class IconToken(val name: String, val autoMirror: Boolean = false) // Pre-built tokens from :tokens-core val token = RikkaIcons.Heart // IconToken("heart") val rtlToken = RikkaIcons.ArrowLeft // IconToken("arrow-left", autoMirror = true) // Create a custom token for your own icon val brandToken = IconToken("brand-logo") val directionalToken = IconToken("send-arrow", autoMirror = true) ``` -------------------------------- ### RikkaIconsExtended Tokens Source: https://context7.com/rainxchzed/rikkaicons/llms.txt Use RikkaIconsExtended for tokens compatible with Material Symbols and at least three vector pack families. This set offers broader coverage while maintaining near-universal pack compatibility. ```kotlin // 238 tokens — Material Symbols + ≥3 of 4 vector packs RikkaIconsExtended.Palette // editor/design RikkaIconsExtended.Atom // science RikkaIconsExtended.Stethoscope // health RikkaIconsExtended.Coffee // food & drink RikkaIconsExtended.Laptop // devices RikkaIconsExtended.Fingerprint // security val allExtended: List = RikkaIconsExtended.all // 238 tokens // Safe to use with any of the four main vector packs ProvideIconPack(PhosphorPack.Regular) { AppIcon(RikkaIconsExtended.Rocket, contentDescription = "Launch") } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.