ToolbarIcon

sealed interface ToolbarIcon

Sealed type describing how a toolbar item renders its icon.

The Composed variant lets state declare per-item dynamic rendering (e.g. annotation color-preview overlays) without forcing every icon to be a drawable resource.

Pre-Phase 0 scaffolding (loophole P1-10).

Inheritors

Types

Link copied to clipboard
data class Composed(val content: @Composable () -> Unit) : ToolbarIcon

Caller-supplied Composable content. Use for items whose icon is a function of state (e.g. annotation color preview circle).

Link copied to clipboard
data class Resource(@DrawableRes val id: Int, val tint: Color? = null) : ToolbarIcon

An icon backed by a drawable resource.

Link copied to clipboard
data class Vector(val image: ImageVector, val tint: Color? = null) : ToolbarIcon

An icon backed by an ImageVector.