Thank you for your interest in contributing to Compose-Settings! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to abide by our Code of Conduct.
- JDK: Version 17 or higher
- Android Studio: Latest stable version (recommended) or IntelliJ IDEA
- Xcode: 14.0+ (for iOS development, macOS only)
- Git: For version control
-
Clone the repository:
git clone https://github.com/alorma/Compose-Settings.git cd Compose-Settings -
Open in IDE:
- Open the project in Android Studio or IntelliJ IDEA
- Wait for Gradle sync to complete
-
Build the project:
./gradlew build
-
Run tests:
./gradlew allTests
Compose-Settings/
├── ui-core/ # Foundation module (shared components)
├── ui-tiles/ # Core settings components
├── ui-tiles-extended/ # Advanced settings components
├── ui-tiles-expressive/ # Expressive Material 3 components
├── samples/ # Sample applications
│ ├── androidApp/ # Android demo
│ ├── desktopApp/ # Desktop (JVM) demo
│ ├── iosApp/ # iOS demo
│ └── webApp/ # Web (JS/WASM) demo
├── build-logic/ # Convention plugins
└── docs/ # Documentation and assets
See ARCHITECTURE.md for detailed architecture information.
- Check if the bug has already been reported in Issues
- If not, create a new issue using the Bug Report template
- Provide as much detail as possible:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Platform (Android, iOS, Desktop, Web)
- Library version
- Code samples or screenshots
- Check if the feature has already been requested in Issues
- Create a new issue using the Feature Request template
- Describe:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered
- Example use cases
-
Fork the repository and create a new branch from
main:git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make your changes:
- Follow the existing code style
- Write clear, self-documenting code
- Add comments where logic isn't obvious
- Update documentation if needed
-
Test your changes:
# Run all tests ./gradlew allTests # Run checks (includes tests + linting) ./gradlew check # Test on specific platforms ./gradlew desktopTest
-
Commit your changes:
- Write clear, descriptive commit messages
- Follow conventional commit format (optional but appreciated):
feat: add dark mode support to SettingsSwitch fix: resolve crash on iOS when toggling checkbox docs: update README with new component examples
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Use the PR template
- Link related issues
- Provide a clear description of changes
- Add screenshots/videos for UI changes
- Ensure CI checks pass
- Kotlin: Follow Kotlin coding conventions
- Compose: Follow Compose API guidelines
- Formatting: The project uses ktlint for code formatting
# Check formatting ./gradlew ktlintCheck # Auto-format code ./gradlew ktlintFormat
When creating new settings components:
-
Choose the appropriate module:
ui-tiles: Core/basic components (checkbox, switch, menu link, etc.)ui-tiles-extended: Advanced components requiring additional dependencies (slider, etc.)
-
Use the scaffold pattern:
- Build on
SettingsTileScaffoldfromui-core - This ensures consistent layout and theming
- Build on
-
Follow the API pattern:
@Composable fun SettingsYourComponent( title: @Composable () -> Unit, modifier: Modifier = Modifier, subtitle: @Composable (() -> Unit)? = null, icon: @Composable (() -> Unit)? = null, enabled: Boolean = true, colors: ListItemColors = SettingsTileDefaults.colors(), // Component-specific parameters ) { // Implementation using SettingsTileScaffold }
-
Respect LocalSettingsGroupEnabled:
val groupEnabled = LocalSettingsGroupEnabled.current val actualEnabled = enabled && groupEnabled
-
Add to sample apps:
- Add examples to
samples/shared/ - Ensure it works across all platforms
- Add examples to
-
Document the component:
- Add KDoc comments
- Update README.md with usage example
- Add screenshots to
docs/art/
- Place platform-specific implementations in the appropriate source set:
commonMain/- Shared codeandroidMain/- Android-specificiosMain/- iOS-specificdesktopMain/- JVM desktopjsMain/- JavaScriptwasmJsMain/- WebAssembly
- Write tests for new functionality
- Ensure existing tests still pass
- Test on multiple platforms when possible
- Use descriptive test names
- Update README.md if adding new components
- Update ARCHITECTURE.md for architectural changes
- Add KDoc comments to public APIs
- Include code examples in documentation
./gradlew :samples:androidApp:assembleDebug
# Or open in Android Studio and run./gradlew :samples:desktopApp:run# Open in Xcode
open samples/iosApp/iosApp.xcodeproj
# Or use command line
cd samples/iosApp
xcodebuild -project iosApp.xcodeproj -scheme iosApp./gradlew :samples:webApp:jsBrowserDevelopmentRun
# Or for WASM
./gradlew :samples:webApp:wasmJsBrowserDevelopmentRunSee PUBLISHING.md for detailed publishing instructions.
- Open a Discussion
- Check existing Issues
- Review the Documentation
By contributing, you agree that your contributions will be licensed under the same license as the project (see LICENSE).