
Creates a 3D tag cloud, allowing items to be placed on a spherical surface with customizable appearance and behavior. Includes examples and comprehensive usage instructions.
Tag cloud as 3D sphere.
Allows to place items on the sphere to create a tag cloud.
Library supports Android, iOS and Desktop (Windows, MacOS, Linux) targets.
See Demo application and examples.
Step 1. Add the MavenCentral repository to your build file.
Add it in your root build.gradle.kts at the end of repositories:
allprojects {
repositories {
...
mavenCentral()
}
}Or in settings.gradle.kts:
dependencyResolutionManagement {
repositories {
...
mavenCentral()
}
}Step 2. Add the dependency. Check latest version on the releases page.
dependencies {
implementation("io.github.oleksandrbalan:tagcloud:$version")
}The TagCloud has 2 mandatory arguments:
Inside content lambda use item or items method to register items in the TagCloud. Each method has own content lambda to specify how item is displayed. Inside item scope you could access item's coordinates to adjust appearance based on where item is currently in the tag cloud. Or you may use .tagCloudItemFade() and / or .tagCloudItemScaleDown() modifiers to use out-of-box behavior.
val labels = List(32) { "Item #$it" }
TagCloud(
state = rememberTagCloudState(),
contentPadding = PaddingValues(64.dp),
) {
items(labels) {
Text(
text = it,
modifier = Modifier
.tagCloudItemFade()
.tagCloudItemScaleDown()
)
}
}
See Demo application and examples for more usage examples.
animateTo / animateBy methods to the TagCloudState
Tag cloud as 3D sphere.
Allows to place items on the sphere to create a tag cloud.
Library supports Android, iOS and Desktop (Windows, MacOS, Linux) targets.
See Demo application and examples.
Step 1. Add the MavenCentral repository to your build file.
Add it in your root build.gradle.kts at the end of repositories:
allprojects {
repositories {
...
mavenCentral()
}
}Or in settings.gradle.kts:
dependencyResolutionManagement {
repositories {
...
mavenCentral()
}
}Step 2. Add the dependency. Check latest version on the releases page.
dependencies {
implementation("io.github.oleksandrbalan:tagcloud:$version")
}The TagCloud has 2 mandatory arguments:
Inside content lambda use item or items method to register items in the TagCloud. Each method has own content lambda to specify how item is displayed. Inside item scope you could access item's coordinates to adjust appearance based on where item is currently in the tag cloud. Or you may use .tagCloudItemFade() and / or .tagCloudItemScaleDown() modifiers to use out-of-box behavior.
val labels = List(32) { "Item #$it" }
TagCloud(
state = rememberTagCloudState(),
contentPadding = PaddingValues(64.dp),
) {
items(labels) {
Text(
text = it,
modifier = Modifier
.tagCloudItemFade()
.tagCloudItemScaleDown()
)
}
}
See Demo application and examples for more usage examples.
animateTo / animateBy methods to the TagCloudState