Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CurvedText - KMP Curved TextView 🌈

Maven Central Version

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!


✨ Features

  • 🌈 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 Support

Platform Supported
Android βœ…
iOS βœ…
Desktop (JVM) βœ…
WebAssembly βœ…

πŸš€ Installation

Add the dependency to your commonMain source set:

// build.gradle.kts
commonMain.dependencies {
    implementation("com.dontsaybojio:curvedtext:x.x.x")
}

πŸ› οΈ Usage

Basic upward curve (rainbow 🌈)

upward

CurvedText(
    text = "Hello Rainbow Text!",
    radius = 200.dp
)

Downward curve (frown πŸ™ƒ)

downward

CurvedText(
    text = "Curved Downward",
    radius = (-150).dp,
    color = Color.Blue
)

With custom style

fonts

CurvedText(
    text = "CURVED HEADLINE",
    radius = 150.dp,
    style = MaterialTheme.typography.headlineSmall.copy(
        fontWeight = FontWeight.Bold,
        color = Color(0xFF6200EE)
    )
)

Mixing individual parameters

length

CurvedText(
    text = "Stylish Curve ✨",
    radius = 120.dp,
    fontSize = 20.sp,
    fontWeight = FontWeight.SemiBold,
    color = Color(0xFFFF6B35),
    letterSpacing = 2.sp
)

πŸ’‘ Tip: A larger radius creates a gentler, more subtle curve. A smaller radius creates a tighter, more dramatic arc!


πŸ“– API Reference

CurvedText

@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.

πŸ™Œ Contributing

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! πŸ’ͺ

Releases

Packages

Contributors

Languages