diff --git a/compose/ui/ui/src/jsWasmMain/kotlin/androidx/compose/ui/input/pointer/PointerIcon.js.kt b/compose/ui/ui/src/jsWasmMain/kotlin/androidx/compose/ui/input/pointer/PointerIcon.js.kt index c3c9170dddd78..b9ba7f8dfeb0e 100644 --- a/compose/ui/ui/src/jsWasmMain/kotlin/androidx/compose/ui/input/pointer/PointerIcon.js.kt +++ b/compose/ui/ui/src/jsWasmMain/kotlin/androidx/compose/ui/input/pointer/PointerIcon.js.kt @@ -16,10 +16,22 @@ package androidx.compose.ui.input.pointer +import androidx.compose.ui.ExperimentalComposeUiApi + object DummyPointerIcon : PointerIcon internal data class BrowserCursor(val id: String): PointerIcon +/** + * Creates [PointerIcon] from provided cursor keyword. + * @param keyword one of the values representing the cursor appearance in a browser. + * @see https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + */ +@ExperimentalComposeUiApi +fun PointerIcon.Companion.fromKeyword(keyword: String): PointerIcon { + return BrowserCursor(keyword) +} + internal actual val pointerIconDefault: PointerIcon = BrowserCursor("default") internal actual val pointerIconCrosshair: PointerIcon = BrowserCursor("crosshair") internal actual val pointerIconText: PointerIcon = BrowserCursor("text")