Skip to main content
Version: Next

Badge API

import { Badge } from '@editora/ui-react';

Props​

PropTypeDescription
autoRemoveboolean
childrenReact.ReactNode
disabledboolean
dotboolean
elevation'none' | 'low' | 'high'
iconOnlyboolean
interactiveboolean
maxWidthstring
onRemove(detail: BadgeRemoveDetail) => void
pillboolean
radius'none' | 'sm' | 'md' | 'lg' | 'large' | 'full' | number | string
removableboolean
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '1' | '2' | '3'
state'idle' | 'loading' | 'error' | 'success'
textstring
tone'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'purple'
truncateboolean
variant'surface' | 'solid' | 'soft' | 'outline' | 'ghost'

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

Element: <ui-badge>​

Badge renders the ui-badge custom element from @editora/ui-core, which can also be used without React.

Attributes: auto-remove, disabled, dot, elevation, headless, icon-only, interactive, max-width, pill, radius, removable, size, state, text, tone, truncate, variant

Events: remove, ui-remove