prongs
GitHub

nav.dot

Shows which item of a set is open, and opens that one, when the items have no titles: the photos in a dialog.media, the slides of a carousel. Pass current on the one shown, and a label like "Photo 2 of 5"

Component

Renders

<a>

Profile

Comes from

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

Example

Preview
defaultcurrentdisabled
<Action intent="nav.dot" href="/somewhere" current={isCurrent} label={`Photo ${index + 1} of ${photos.length}`} />

Connections

Choosing between neighbours

  • If it is

    Use

  • Shows which item of a set is open, and opens that one, when the items have no titles: the photos in a dialog.media, the slides of a carousel. Pass current on the one shown, and a label like "Photo 2 of 5"

    nav.dot
  • Pages of a long list or table

    nav.paging

For registry authors

Pack intent. prongs add media puts the media pack’s intents in your registry. They are then yours like the starter intents: 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 nav.dot 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.

  • control.base

    Shape and behaviour shared by every button

    inline-flex shrink-0 items-center justify-center gap-2
    whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium
    transition-colors focus-visible:outline-none
    focus-visible:ring-2 focus-visible:ring-ring
    focus-visible:ring-offset-2 ring-offset-surface
    disabled:pointer-events-none disabled:opacity-50
    aria-disabled:pointer-events-none aria-disabled:opacity-50
    data-[tone=danger]:[--row-fg:var(--destructive)]
  • nav.dot

    Shows which item of a set is open, and opens that one, when the items have no titles: the photos in a dialog.media, the slides of a carousel. Pass current on the one shown, and a label like "Photo 2 of 5"

    size-1.5 rounded-full bg-white/55 p-0 ring-1 ring-black/30
    hover:bg-white/85 aria-[current]:bg-white
Final classes
inline-flex shrink-0 items-center justify-center gap-2
whitespace-nowrap text-sm font-medium transition-colors
focus-visible:outline-none focus-visible:ring-2
focus-visible:ring-ring focus-visible:ring-offset-2
ring-offset-surface disabled:pointer-events-none
disabled:opacity-50 aria-disabled:pointer-events-none
aria-disabled:opacity-50
data-[tone=danger]:[--row-fg:var(--destructive)] size-1.5
rounded-full bg-white/55 p-0 ring-1 ring-black/30
hover:bg-white/85 aria-[current]:bg-white
Definition
TS
'nav.dot': {
kind: 'semantic',
description: 'Shows which item of a set is open, and opens that one, when the items have no titles: the photos in a dialog.media, the slides of a carousel. Pass current on the one shown, and a label like "Photo 2 of 5"',
refs: ['control.base'],
binding: {
classes: 'size-1.5 rounded-full bg-white/55 p-0 ring-1 ring-black/30 hover:bg-white/85 aria-[current]:bg-white',
},
notFor: [{ context: 'pages of a long list or table', instead: 'nav.paging' }],
},