state

fun state(name: String, block: StateBuilder.() -> Unit)(source)

Declare a top-level state with the given name and configure it via block. The block may itself declare substates via nested state calls, producing a composite state.