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

NameDescription
bottom Type: booleanDefaultfalse

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

See example
dot Type: booleanDefaultfalse

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
left Type: booleanDefaultfalse

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

See example
max Type: number

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

See example
pt Type: PtMap<BbIndicatorPtPart, "default" | "destructive" | "warning" | "success" | "info">

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

pt:<part> Type: PtValue

Passthrough, attribute form: one attribute per part, pt:<part>, and per part and state, pt:<part>:<state>. Parts: bubble, root. States: default, destructive, info, success, warning.

See example
size Type: keyof SizesDefault"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
text Type: string | number

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
variant Type: keyof IndicatorVariantRegistryDefault"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.

NameDescription
default Type: object

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