mkosm
kotlinx.html
class MyCustomElement(consumer: TagConsumer<*>) : HTMLTag("my-custom-element", consumer, emptyMap(), inlineTag = true, emptyTag = true), HtmlInlineTag inline fun RBuilder.myCustomElement(block: RDOMBuilder<MyCustomElement>.() -> Unit): ReactElement = tag(block) { MyCustomElement(it) } // How to use: myCustomElement { attrs { id = "my-custom-element-id" } }
turansky
external interface MyCustomElementProps: HTMLAttributes<HtmlElement> val MyCustomElement = IntrinsicType<MyCustomElementProps>("my-custom-element-id") // inside component val App = FC { MyCustomElement { id = "my-custom-element-id" } }
A modern programming language that makes developers happier.