Skip to content

draw a super smooth roundedCornerShape in compose multiplatform.

Notifications You must be signed in to change notification settings

adamglin0/compose-SuperRoundedCornerShape

Repository files navigation

Compose SuperRoundedCornerShape

SuperRoundedShape for Compose Multiplatform.

Maven Central Version


Versions

compose-super-rounded-shape CMP Kotlin
0.0.1-beta10 1.7.1 2.1.0

Installation

implementation("com.adamglin:compose-super-rounded-corner-shape:$version")

Platform support

compose-super-rounded-corner-shape supports these platforms:

  1. Android
  2. iOS
  3. Desktop (JVM)
  4. JS/Wasm (now using RoundedCornerShape compatibility, waiting androidx-graphics-shapes support web target. )

Use

SuperRoundedCornerShape(50.dp, smooth = 1f)

smooth support from 0f to 1f, the design of ios is 0.6f.

Box {
    Box(
        modifier = Modifier
            .padding(20.dp)
            .size(300.dp)
            .clip(RoundedCornerShape(50.dp)) // .clip(RoundedCornerShape(50.dp,50.dp,50.dp,50.dp,0.6f))
            .background(Color.Black)
    )
    Box(
        modifier = Modifier
            .padding(20.dp)
            .size(300.dp)
            .clip(SuperRoundedCornerShape(50.dp, smooth = 1f))
            .background(Color.Red)
    )
}

img.png

About

draw a super smooth roundedCornerShape in compose multiplatform.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages