className

abstract fun className(value: String)

Adds a String of class names to the classes attribute of this Tag

Parameters

value

abstract fun className(value: Flow<String>, initial: String = "")

Adds a Flow of class names to the classes attribute of this Tag

Parameters

value

Flow with String


open fun <T> className(value: Flow<T>, initial: T, transform: (T) -> String)

Uses a Flow of T to create some class names by a transform lambda expression and add them to the classes attribute of the Tag.

In order to set some classes immediately, you must provide an initial T which is used to create the initial classes value with the transform lambda.

Use this function to avoid flickering effects on reactively based styling!

Parameters

value

a Flow of T that provides the parameter for the transform lambda

initial

a T to be used as initial state in order to generate and add class names immediately without waiting for the first value of the Flow

transform

a lambda expression which finally creates class names by passing one T