Skip to main content

Tag

Examples

Tag as text

View standalone

Tag as text


Code
<Tag>
Tag as text
</Tag>

Tag with href

View standalone

Code
<Tag href="/">
Tag as anchor
</Tag>

Closeable Tag

View standalone

Closable Tag


Code
<Tag
closeable
onClose={function noRefCheck() {}}
>
Closable Tag
</Tag>

Closeable Tag with custom close button text

View standalone

Closable Tag


Code
<Tag
closeText="Remove filter"
closeable
onClose={function noRefCheck() {}}
>
Closable Tag
</Tag>

Clickable Tag

View standalone

Code
<Tag onClick={function noRefCheck() {}}>
Clickable Tag
</Tag>

Props

as

"a" | "button" | "div"

theme

Theme

loading

"eager" | "lazy"

Not included in `AllHTMLAttributes` yet so sourced from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img

decoding

"auto" | "sync" | "async"

Not included in `AllHTMLAttributes` yet so sourced from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img

inputRef

Ref<HTMLElement>

Has to not be called ref - done because we also want to use a generic see https://gist.github.com/gaearon/1a018a023347fe1c2476073330cc5509

closeable

boolean

closeText

string

Default: "Close"

onClose

() => void