kiwicom / orbit-compose

Android Jetpack Compose components of open-source Orbit design system by Kiwi.com.
https://orbit.kiwi
MIT License
157 stars 22 forks source link
android design-system jetpack-compose kotlin orbit
orbit-components **Orbit Compose** [![Kiwi.com library](https://img.shields.io/badge/Kiwi.com-library-00A991)](https://code.kiwi.com) [![CI Build](https://img.shields.io/github/actions/workflow/status/kiwicom/orbit-compose/build.yml?branch=main)](https://github.com/kiwicom/orbit-compose/actions/workflows/build.yml) [![GitHub release](https://img.shields.io/github/v/release/kiwicom/orbit-compose)](https://github.com/kiwicom/orbit-compose/releases) [![Maven release](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fkiwi%2Forbit%2Fcompose%2Fui%2Fmaven-metadata.xml)](https://search.maven.org/search?q=g:kiwi.orbit.compose) [![Compose 1.6](https://img.shields.io/badge/Compose-1.6-00A991)](https://developer.android.com/jetpack/androidx/releases/compose-kotlin) [![Compose M3 1.2](https://img.shields.io/badge/Compose%20M3-1.2-00A991)](https://developer.android.com/jetpack/androidx/releases/compose-material3)

About Orbit

Orbit is an open-source design system that aims to bring order and consistency to Kiwi.com products as well as the processes behind building them. It elevates the user experience and increases the speed and efficiency of how we design and build products.

This library allows developers to implement Orbit in a project using Jetpack Compose for Android.

Orbit Compose builds upon Material 3 library. If you need an integration with Material 2, see Theming chapter.

Setup

We publish our releases in Maven Central. To use this library, you can add the following dependencies to your Gradle file:

implementation("kiwi.orbit.compose:ui:<version>")
implementation("kiwi.orbit.compose:icons:<version>")
implementation("kiwi.orbit.compose:illustrations:<version>")

How to use?

In order to use one of Orbit's components, simply add them to your Composable function.

@Composable
fun MyScreen() {
    Column(
        verticalArrangement = Arrangement.spacedBy(8.dp),
        modifier = Modifier.padding(16.dp)
    ) {
        val maxWidth = Modifier.fillMaxWidth()

        ButtonPrimary(onClick = {}, maxWidth) {
            Text("This is an Orbit primary button")
        }

        Spacer(modifier = Modifier.padding(4.dp))

        AlertCritical(
            title = { Text("Alert title") },
            content = { Text("Content description") },
            actions = {
                ButtonPrimary(onClick = {}) { Text("Primary") }
                ButtonSecondary(onClick = {}) { Text("Secondary") }
            },
        )
    }
}

Colors, typography, and other foundational elements can be used by accessing the OrbitTheme object:

Text("Title 1", emphasis = ContentEmphasis.Minor)
Text("Big title in Title 1 style", style = OrbitTheme.typography.title1)
Text("Check your typography styles!", color = OrbitTheme.colors.warning.normal)
![Orbit Button and Alert component](./docs/readme/button_and_alert.png) ![Orbit typography and colors](./docs/readme/styled_text.png)

Icons and Illustrations

Icons and illustrations can be accessed in the same way, with the corresponding Icons and Illustrations objects:

Image(painter = Illustrations.AppKiwi, contentDescription = "app_kiwi")

Documentation

You can check out our component Catalog by downloading and installing our showcase application from Google Play.

The API documentation lists all possible types and composables in our library.

Contributing

Read our contributing guidelines to see how you can participate in this project.

Feedback

Any feedback you have for us is appreciated. If you have any suggestions about what we can do, do not hesitate to report the issue and we'll take a look at it.