function createBadge
createBadge(
text: string,
props?: BadgeProps,
): HTMLSpanElement

Create a badge DOM element

Use this when building UI imperatively in vanilla JS.

Examples

Example 1

const badge = createBadge('OK', { variant: 'success' }); row.querySelector('.status-cell').appendChild(badge);

Parameters

text: string
  • Badge content
optional
props: BadgeProps
  • Badge configuration

Return Type

HTMLSpanElement

HTMLSpanElement

Usage

import { createBadge } from ".";