The --add-all command generates all available UI components and their dependencies in your project.
Syntax
What It Does
The add-all command:
Validates your lumo.properties configuration
Iterates through all available components
Generates each component file and its dependencies
Creates platform-specific files for Kotlin Multiplatform projects
Provides a summary for each component
This command is equivalent to running ./gradlew lumo --add <ComponentName> for every available component.
Components Generated
The command generates all 26 components:
Card
Divider
ModalBottomSheet
Scaffold
Surface
SystemBars
Navigation Components (2)
AlertDialog
ProgressIndicators
Snackbar
Tooltip
Accordion
Badge
Icon
Text
Theme
Output Example
When successful, you’ll see output for each component:
Generating Accordion ...
Generated 'Accordion' files:
/path/to/project/app/src/main/java/com/example/ui/components/Accordion.kt
'Accordion' generated successfully.
Generated Files: 1
Generating AlertDialog ...
Generated 'AlertDialog' files:
/path/to/project/app/src/main/java/com/example/ui/components/AlertDialog.kt
'AlertDialog' generated successfully.
Generated Files: 1
Generating Badge ...
Generated supporting files:
/path/to/project/app/src/main/java/com/example/ui/components/Surface.kt
Generated 'Badge' files:
/path/to/project/app/src/main/java/com/example/ui/components/Badge.kt
'Badge' generated successfully.
Generated Files: 2
... (continues for all components )
Prerequisites
Ensure you have completed the initial setup before running this command.
Required steps:
Run ./gradlew lumo --init
Configure lumo.properties with your project details
Add required dependencies to build.gradle.kts
Run ./gradlew lumo --setup to generate theme files
File Structure
After running add-all, your components directory will contain:
ComponentsDir/
├── Accordion.kt
├── AlertDialog.kt
├── Badge.kt
├── Button.kt
├── Card.kt
├── Checkbox.kt
├── Chip.kt
├── Divider.kt
├── Icon.kt
├── IconButton.kt
├── ModalBottomSheet.kt
├── NavigationBar.kt
├── OTPTextField.kt
├── ProgressIndicators.kt
├── RadioButton.kt
├── Scaffold.kt
├── Slider.kt
├── Snackbar.kt
├── Surface.kt
├── Switch.kt
├── SystemBars.kt
├── Text.kt
├── TextField.kt
├── Tooltip.kt
├── TopBar.kt
└── theme/
├── Theme.kt
├── Color.kt
└── Type.kt
Handling Existing Files
The command will skip files that already exist rather than overwriting them.
If components already exist:
Generating Button ...
Failed to generate some files as they already exist:
/path/to/Button.kt
'Button' generated successfully.
Generated Files: 0
Failed to Generate: 1
This prevents accidental overwrites of customized components.
Generating all components typically takes:
Android projects: 10-30 seconds
Kotlin Multiplatform projects: 20-60 seconds (due to platform-specific files)
The exact time depends on:
Number of components
Number of target platforms (for KMP)
File system performance
Error Cases
Configuration Not Found The plugin is not setup. Run the plugin with --init to get started.
Solution: Complete initialization first.
Invalid Directory Failed to create parent directory: /invalid/path
Possible reasons: existing file or any of the parent directory does not exists.
Solution: Verify ComponentsDir in lumo.properties is a valid path.
Missing Configuration Properties Missing required configs in lumo.properties. Expected: [ThemeName, ComponentsDir, PackageName].
Solution: Ensure all required properties are set in lumo.properties.
For Kotlin Multiplatform projects with KotlinMultiplatform=true:
Common components go to commonMain
Platform-specific implementations are generated when needed
The plugin automatically detects available source sets
Example output:
Generating SystemBars ...
Generated 'SystemBars' files:
/path/to/shared/src/commonMain/kotlin/com/example/ui/components/SystemBars.kt
/path/to/shared/src/androidMain/kotlin/com/example/ui/components/SystemBars.android.kt
/path/to/shared/src/iosMain/kotlin/com/example/ui/components/SystemBars.ios.kt
'SystemBars' generated successfully.
Generated Files: 3
Selective vs Complete Generation
Use add-all when
Use individual add when
Starting a new project
You want the complete component library
Building a comprehensive design system
You have unlimited bundle size
You only need specific components
Minimizing bundle size is important
Working on an existing project
Adding components incrementally
After Generation
Once all components are generated:
Review the files - Check that all components were created successfully
Customize as needed - Modify components to match your design system
Build your project - Run ./gradlew build to ensure everything compiles
Start using components - Import and use them in your UI code
import com.example.ui.components. *
import com.example.ui.components.theme.MyAppTheme
@Composable
fun App () {
MyAppTheme {
Scaffold (
topBar = { TopBar (title = "My App" ) },
bottomBar = { NavigationBar { /* nav items */ } }
) { padding ->
Card (modifier = Modifier. padding (padding)) {
Text ( "Welcome!" )
Button (onClick = { /* action */ }) {
Text ( "Get Started" )
}
}
}
}
}
Cleaning Up
If you want to regenerate all components:
# Remove all generated components
rm -rf path/to/components/ *
# Regenerate
./gradlew lumo --add-all
Be careful when deleting components if you’ve made customizations. Consider using version control to track changes.
Tips
Start with add-all For new projects, it’s often easier to generate all components upfront, then delete the ones you don’t need.
Use version control Commit generated components to git so you can track customizations and revert if needed.
Incremental approach If unsure, start with --setup and specific --add commands, then use --add-all later if you need more components.
Next Steps