Skip to content

Repository files navigation

Mobi Lab

Mobi Lab Components for Compose

Mobi Lab Components for Compose (LabComponentsCompose) help developers execute our internal design system's components on the Android platform.

Maven Central artifact available from https://central.sonatype.com/search?q=mobi.lab.labcomponents:labcomponents-compose

implementation 'mobi.lab.labcomponents:labcomponents-compose:0.0.9'

The components provide implementations for Mobi Lab's design system. These components are based on Material Components for Android.

Compatible versions

Lab Components for Compose versionCompose BOM version usedCompileSdk used
0.0.92025.05.00API 36 / Android 16
0.0.82025.05.00API 36 / Android 16
0.0.72025.05.00API 36 / Android 16
0.0.62025.05.00API 36 / Android 16
0.0.52025.05.00API 36 / Android 16
0.0.42025.04.01API 36 / Android 16
0.0.32025.04.01API 36 / Android 16
0.0.22025.04.01API 36 / Android 16
0.0.12025.04.01API 36 / Android 16

Description

The library contains a ready-to-use Compose implementation of the components from Mobi Lab's design system. Mobi Lab's design system allows teams to focus on solving business problems instead of reinventing basic design system and UI components at the design and implementation phases.

The project consists of the component library in lib module and the components demo application in app-demo module.

Buttons

Filled button

Filled button

// MediumLabFilledButton(
text ="Click Me!",
onClick = {},
enabled = enabled.value
)
// SmallLabFilledSmallButton(
text ="Click Me!",
onClick = {},
)

Toned button

Toned button

// MediumLabTonedButton(
text ="Click Me!",
onClick = {},
)
// SmallLabTonedSmallButton(
text ="Click Me!",
onClick = {},
)

Outlined button

Outlined button

// MediumLabOutlinedButton(
text ="Click Me!",
onClick = {},
)
// SmallLabOutlinedSmallButton(
text = text ="Click Me!",
onClick = {},
)

Text button

Text button

// MediumLabTextButton(
text ="Click Me!",
onClick = {},
)
// SmallLabTextSmallButton(
text ="Click Me!",
onClick = {},
)

Icon button

Icon button

// MediumLabIconButton(
icon =ImageSource.vector(Icons.Filled.FavoriteBorder),
contentDescription ="Like",
onClick = {},
)
// SmallLabIconSmallButton(
icon =ImageSource.vector(Icons.Filled.FavoriteBorder),
contentDescription ="Like",
onClick = {},
)

See

Colors

See

Text fields

Text field with a label

TextField with a label

var text1:String by rememberSaveable { mutableStateOf("Input") }
LabTextField(
modifier =Modifier.fillMaxWidth(),
value = text1,
label ="Label",
onValueChange = { text1 = it },
enabled = enabled.value,
supportingText ="Supporting text",
errorValue ="",
errorReserveSpace =true,
singleLine =true,
)

Text fields for login via email and password

var text2:String by rememberSaveable { mutableStateOf("") }
LabTextField(
modifier =Modifier
.fillMaxWidth()
.semantics { contentType =ContentType.EmailAddress },
value = text2,
onValueChange = { text2 = it },
label ="Email",
enabled = enabled.value,
errorValue = errorText,
errorReserveSpace =true,
singleLine = singleLine.value,
)
var text3:String by rememberSaveable { mutableStateOf("") }
var text3ShowPassword by rememberSaveable { mutableStateOf(false) }
LabTextField(
modifier =Modifier
.fillMaxWidth()
.semantics { contentType =ContentType.Password },
value = text3,
onValueChange = { text3 = it },
label ="Password",
trailingIcon =ImageSource.vector(Icons.Filled.Info),
trailingIconContentDescription ="Toggle password visibility",
onTrailingIconClick = { text3ShowPassword =!text3ShowPassword },
enabled = enabled.value,
errorValue = errorText,
errorReserveSpace =true,
singleLine = singleLine.value,
visualTransformation =if (text3ShowPassword) {
VisualTransformation.None
} else {
PasswordVisualTransformation()
},
keyboardOptions =KeyboardOptions(keyboardType =KeyboardType.Password)
)

See

Top app bar

Top app bar with a title only

TopAppBar with title

// Normal (small) oneLabTopAppBar(
title ="Title",
)

TopAppBar large with title

// Large (two-row) oneLabLargeTopAppBar(
title ="Title",
)

Top app bar with title and up navigation

TopAppBar with title and up

// Normal (small) oneLabTopAppBar(
title ="Title",
navConfig = upNavConfig(),
)

TopAppBar large with title and up

// Large (two-row) oneLabLargeTopAppBar(
title ="Title",
navConfig = upNavConfig(),
)

Top app bar with title, up navigation and action items

TopAppBar with title, up and actions

// Normal (small) oneLabTopAppBar(
title ="Title",
navConfig = upNavConfig(),
actions = {
LabIconButton(
icon =ImageSource.vector(Icons.Filled.Edit),
contentDescription ="Edit",
onClick = {},
)
LabIconButton(
icon =ImageSource.vector(Icons.Filled.Email),
contentDescription ="Email",
onClick = {},
)
LabIconButton(
icon =ImageSource.vector(Icons.Filled.Call),
contentDescription ="Call",
onClick = {},
)
},
)

TopAppBar large with title, up and actions

// Large (two-row) oneLabLargeTopAppBar(
title ="Title",
navConfig = upNavConfig(),
actions = {
LabIconButton(
icon =ImageSource.vector(Icons.Filled.Edit),
contentDescription ="Edit",
onClick = {},
)
LabIconButton(
icon =ImageSource.vector(Icons.Filled.Email),
contentDescription ="Email",
onClick = {},
)
LabIconButton(
icon =ImageSource.vector(Icons.Filled.Call),
contentDescription ="Call",
onClick = {},
)
},
)

See

Typography

See

Progress indicators

Indeterminate progress

Indeterminate progress

LabIndeterminateCircularIndicator()

Indeterminate progress with a larger size

LabIndeterminateCircularIndicator(modifier =Modifier.size(40.dp))

See

Switch

Warning: LabSwitch is not yet fully specified in the design system and will likely change in the future.

LabSwitch checked

LabSwitch unchecked

val checked = rememberSaveable { mutableStateOf(true) }
LabSwitch(
checked = checked.value,
onCheckedChange = { checked.value =!checked.value }
)

See

Links

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

1 star

Watchers

5 watching

Forks

Releases

Packages

Contributors

Languages