prongs
GitHub

text.indicator

Marks something as new or unread, or shows a status, with no word or number. Give it an aria-label, like "Unread" or "Charging"; data-tone="success", "info", "warning", "danger" or "muted" colours a status; data-busy shows it is in progress

Component

Renders

<span>

Role

img

Profile

Comes from

starter
Read https://www.prongs.dev/docs/intents/text/indicator.md and tell me whether text.indicator fits what I am building.

Example

Preview
defaultsuccessinfopendingwarningdangermuted
<Text intent="text.indicator" aria-label="Indicator" />

Connections

Choosing between neighbours

  • If it is

    Use

  • Marks something as new or unread, or shows a status, with no word or number. Give it an aria-label, like "Unread" or "Charging"; data-tone="success", "info", "warning", "danger" or "muted" colours a status; data-busy shows it is in progress

    text.indicator
  • How many new things there are

    text.count
  • A status shown as a mark alone

    rather than text.status
    text.indicator
  • A status dot beside a word

    rather than layout.badged
    text.indicator

For registry authors

Starter intents. These are the intents prongs add puts in your registry, shown in this site’s theme. Yours are your own registry.ts: rename, restyle and add to them, and see them with prongs add gallery.

What this intent is built from and its entry in components/prongs/registry.ts. You only need this to change how it looks or to add an intent like it.

How text.indicator resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

  • tone.accent

    Brand text colour

    text-primary
  • text.indicator

    Marks something as new or unread, or shows a status, with no word or number. Give it an aria-label, like "Unread" or "Charging"; data-tone="success", "info", "warning", "danger" or "muted" colours a status; data-busy shows it is in progress

    inline-block size-2 shrink-0 rounded-full bg-current
    data-[tone=success]:text-success data-[tone=info]:text-info
    data-[tone=warning]:text-warning
    data-[tone=danger]:text-destructive
    data-[tone=muted]:text-surface-muted data-[busy]:animate-pulse
    motion-reduce:animate-none
Final classes
text-primary inline-block size-2 shrink-0 rounded-full
bg-current data-[tone=success]:text-success
data-[tone=info]:text-info data-[tone=warning]:text-warning
data-[tone=danger]:text-destructive
data-[tone=muted]:text-surface-muted data-[busy]:animate-pulse
motion-reduce:animate-none
Definition
TS
'text.indicator': {
kind: 'semantic',
description: 'Marks something as new or unread, or shows a status, with no word or number. Give it an aria-label, like "Unread" or "Charging"; data-tone="success", "info", "warning", "danger" or "muted" colours a status; data-busy shows it is in progress',
refs: ['tone.accent'],
binding: {
element: 'span',
ariaRole: 'img',
classes: 'inline-block size-2 shrink-0 rounded-full bg-current data-[tone=success]:text-success data-[tone=info]:text-info data-[tone=warning]:text-warning data-[tone=danger]:text-destructive data-[tone=muted]:text-surface-muted data-[busy]:animate-pulse motion-reduce:animate-none',
},
notFor: [{ context: 'how many new things there are', instead: 'text.count' }],
},