Skip to main content
Version: 12.10.0

Spinner Component

Loading Spinners are circular progress indicators. They show progress in a process by an animated progress indicator spinning clockwise along an invisible circle. There are four sizes of Loading Spinners: Small, Regular, Medium and Large.

Features

  • Create Spinner.
  • Customize size, spinner tint color, textStyle, loading text of the Spinner,
  • Interact with Spinner by setting spinner style (spinner size, spinner tint color(Optional), textStyle(Optional)), loading text(Optional) .

Usage 🔑

  1. Import the necessary components: Ensure you've imported the required Spinner Composable and other necessary components at the top of your Kotlin file.

import androidx.compose.runtime.* import androidx.compose.ui.* // ... other required imports

  1. Use the OCSpinner Composable: In your UI, you can then add the OCSpinner composable: @Composable fun yourComposable() { // ... start

    OCSpinner( loadingText = "Please wait, your content is being loaded...", spinnerStyle = OCSpinnerConfig.OCSpinnerStyle( spinnerStyle = Large, spinnerTintColor = Color.Blue, textStyle = OCTheme.typography.body2Regular.copy( letterSpacing = LocalDimensions.current.pointOneFiveSpTextSize, ), ), )

    // ... rest of code } Parameters:

modifier: Modifier: Modifier for styling and layout. loadingText: String: Text that is shown under loading spinner that represents the details of the spinner or loading indicator. spinnerStyle: OCSpinnerConfig.OCSpinnerStyle = User can customize spinner size, spinner tint color, textStyle of the spinner.