A Kotlin Multiplatform Compose library that lets you render text curved along a circular arc β like a rainbow βοΈ or a frown π. Works across Android, iOS, Desktop, and WebAssembly!
- π Upward curves β rainbow / smile style
- π Downward curves β frown / arc style
- π¨ Fully styleable β color, font size, weight, family, letter spacing, decorations
- π Auto-sizing canvas β the composable sizes itself to fit the text perfectly
- π§© Drop-in Composable β works just like
Text()
| Platform | Supported |
|---|---|
| Android | β |
| iOS | β |
| Desktop (JVM) | β |
| WebAssembly | β |
Add the dependency to your commonMain source set:
// build.gradle.kts
commonMain.dependencies {
implementation("com.dontsaybojio:curvedtext:x.x.x")
}CurvedText(
text = "Hello Rainbow Text!",
radius = 200.dp
)CurvedText(
text = "Curved Downward",
radius = (-150).dp,
color = Color.Blue
)CurvedText(
text = "CURVED HEADLINE",
radius = 150.dp,
style = MaterialTheme.typography.headlineSmall.copy(
fontWeight = FontWeight.Bold,
color = Color(0xFF6200EE)
)
)CurvedText(
text = "Stylish Curve β¨",
radius = 120.dp,
fontSize = 20.sp,
fontWeight = FontWeight.SemiBold,
color = Color(0xFFFF6B35),
letterSpacing = 2.sp
)π‘ Tip: A larger
radiuscreates a gentler, more subtle curve. A smallerradiuscreates a tighter, more dramatic arc!
@Composable
fun CurvedText(
text: String,
radius: Dp,
modifier: Modifier = Modifier,
style: TextStyle = LocalTextStyle.current,
color: Color = Color.Unspecified,
fontSize: TextUnit = TextUnit.Unspecified,
fontStyle: FontStyle? = null,
fontWeight: FontWeight? = null,
fontFamily: FontFamily? = null,
letterSpacing: TextUnit = TextUnit.Unspecified,
textDecoration: TextDecoration? = null,
)| Parameter | Type | Description |
|---|---|---|
text |
String |
The text to display along the curve |
radius |
Dp |
Curve radius. Positive = upward (smile π), Negative = downward (frown π). Larger absolute values = gentler curve |
modifier |
Modifier |
Standard Compose modifier |
style |
TextStyle |
Base text style β merged with individual parameters |
color |
Color |
Text color. Falls back to the color in style if unspecified |
fontSize |
TextUnit |
Font size |
fontStyle |
FontStyle? |
Italic, normal, etc. |
fontWeight |
FontWeight? |
Bold, medium, thin, etc. |
fontFamily |
FontFamily? |
Custom font family |
letterSpacing |
TextUnit |
Space between characters |
textDecoration |
TextDecoration? |
Underline, line-through, etc. |
Contributions are welcome! Feel free to open an issue or submit a pull request on GitHub. Whether it's a bug fix, a new feature idea, or just improving the docs β all help is appreciated! πͺ



