Skip to content

BbIndicator

Anchors a notification bubble (count/short text) or a dot over a wrapped element.

import { BbIndicator } from 'bitboss-ui';

On this page

Props

NameTypeDefaultDescription
bottomboolean | undefinedfalse

Anchors the indicator to the bottom edge of the wrapped element instead of the top.

See example
dotboolean | undefinedfalse

Renders a small contentless dot instead of a labelled bubble. Takes precedence over text.

The precedence is not additive, and it was not in v2 either: a v2 call site that switched the dot on from a count never showed the number. Carry dot across unchanged unless you mean to change the design.

See example
leftboolean | undefinedfalse

Anchors the indicator to the left edge of the wrapped element instead of the right.

See example
maxnumber | undefined-

Caps a numeric text count: values above max render as ${max}+ (e.g. max: 99 shows 99+). Ignored for string text.

See example
ptPtMap<BbIndicatorPtPart, never> | undefined-

Passthrough, object form: the same keys as the pt:* attributes without the prefix. See the pt:<part> row.

pt:bubblePtValue | undefined-
pt:rootPtValue | undefined-
sizekeyof Sizes | undefined"md"

Preset size of the indicator.

Match the element being decorated rather than the text inside the bubble. An off-scale value warns in development and falls back to md.

See example
textstring | number | undefined-

Content shown inside the indicator bubble. A number is accepted for count ergonomics (e.g. :text="unread"). When omitted the indicator renders only if dot is set.

A count of 0 renders as "0" — it is content like any other value. Bind count || undefined to hide the marker when the count empties.

See example
variantkeyof IndicatorVariantRegistry | undefined"default"

Visual variant. default uses the primary color; success, info, warning and destructive map to the shared status colors. Register more via the vite plugin indicatorVariants option and style .bb-indicator--<variant>.

See example

Slots

The listed properties are the ones exposed to the slot scope.

NameTypeDescription
defaultobject

The element the indicator is anchored to.

The indicator is inert, so anything interactive goes here rather than on the indicator: wrap a BbButton, do not attach a handler. The wrapped element keeps its own semantics and accessible name.

See example