--add command generates a specific UI component and its dependencies in your project.
Syntax
Parameters
The name of the component to add. Component names are case-sensitive.Use
./gradlew lumo --available-components to see all available components.What It Does
The add command:- Validates your
lumo.propertiesconfiguration - Checks that the component name is valid
- Generates the component file(s)
- Generates any supporting/dependency files
- For Kotlin Multiplatform, generates platform-specific files when needed
Available Components
Accordion
AlertDialog
Badge
Button
Card
Checkbox
Chip
Divider
Icon
IconButton
ModalBottomSheet
NavigationBar
OTPTextField
ProgressIndicators
RadioButton
Scaffold
Slider
Surface
Snackbar
Switch
SystemBars
Text
TextField
Theme
Tooltip
TopBar
Examples
Add a Button Component
Add a Card Component
Some components have dependencies on other components. These supporting files are automatically generated.
Add TextField with Dependencies
Prerequisites
Required setup:- Run
./gradlew lumo --init - Configure
lumo.properties - Add required dependencies to
build.gradle.kts - Run
./gradlew lumo --setupto generate theme
Generated Code
Generated component files include:- Fully functional Compose components
- Your configured package name
- Integration with your theme (using
ThemeNamefrom config) - Material3 design patterns
- Customizable parameters
Error Cases
File Locations
Generated files are placed in the directory specified byComponentsDir in your configuration:
Kotlin Multiplatform Support
For Kotlin Multiplatform projects:- Common components are generated in
commonMain - Platform-specific implementations go to
androidMain,iosMain, etc. - The plugin automatically detects source sets based on your directory structure
Using Generated Components
After generation, import and use components in your code:Tips
Next Steps
- Add all components at once
- View available components list
- Customize generated components for your design system
- Build your UI using the components