Skip to main content
Version: Next

checkbox

README.md

:OCCheckBox - A Custom Composable UI Component

This OCCheckBox is a custom Jetpack Compose component designed to select one or more items from a set.

Features:

  • Configurable control with customizable colors.
  • Are used as a list in our forms and signup pages so users can select options of their choice.
  • Users are free to choose how many options to select, from zero to all of them.
  • As each checkbox is independent, this means that additional checkboxes do not affect any other selections.

:How to use OCCheckBox

  1. Add the necessary imports:

    import your.package.name.OCCheckBox

  2. Use the OCCheckBox within your Composable:

    val checkedState = remember { mutableStateOf(false) }
    OCCheckBox(
    state = Active,
    isSelected = checkedState.value,
    onCheckedChange = {
    checkedState.value = it
    })

Parameters:

  • state: represents state of the checkbox.
  • isSelected: Boolean denotes if checkbox is selected or not.
  • checkBoxConfig: (Optional) Configuration to change style of the checkbox.
  • onCheckedChange: A lambda function called when a checkbox is toggled.