GenericTag

@Composable
fun GenericTag(name: String, attrsStr: String? = null, content: @Composable ElementScope<Element>.() -> Unit? = null)(source)

A way to easily specify a generic tag and optional attributes.

See also TagElement, which this delegates to.

Parameters

name

The name of the tag, e.g. "a"

attrsStr

An (optional) list of attributes separated by spaces, e.g. "href=\"...\" target=\"_blank\""


@Composable
fun <E : Element> GenericTag(name: String, namespace: String? = null, attrs: AttrBuilderContext<E>? = null, content: @Composable ElementScope<E>.() -> Unit? = null)(source)

Like the other GenericTag but allows richer typing as well as namespaced elements.

The other GenericTag is useful for contexts like markdown, where you're parsing tags from a string and don't care as much about Kotlin types. This version is a useful way to create composable elements in a type-safe way. Mostly, this was created to allow users to create SVG elements.

Parameters

namespace

If specified, a namespace for the current element, e.g. "http://www.w3.org/2000/svg"