WhatTheStar · /design
primitives type-pill

    Primitive · v1

    TypePill

    A chip that says what kind of thing something is. It takes both its glyph and its colour from src/design/skyTypes.ts, so the caller never picks either — which is the point. Every pill on the site used to be the same grey rectangle, and the only way to tell a galaxy from a star was to read the word.

    — Every type

    Grouped by family. A family shares a tone, because the tone is what the sky already paints; the glyph is what separates members inside it. See Foundations · Sky types for the law the table obeys.

    Stars

    Star Double star Variable star

    Deep sky

    Galaxy Nebula Planetary nebula Open cluster Globular cluster

    Figures

    Constellation Asterism

    Solar system

    The Sun The Moon Planet

    Events

    Meteor shower Satellite pass Conjunction Eclipse Comet

    — Variants

    pill

    Galaxy Star Planet Meteor shower

    The default. A bordered chip naming the kind, for a header or a detail row that has room for the word.

    dot

    Galaxy Star Planet Meteor shower

    The same identity at list density: colour and glyph, no label, for a row that already names the thing beside it. The label survives for screen readers and as a title carrying the gloss.

    label override

    M 31 Dark nebula Dwarf planet

    For a catalogue class sharper than the table's own word. It overrides the text only — never the tone and never the glyph, so a renamed pill still reads as its family.

    — Sizes

    Globular cluster Globular cluster Globular cluster Globular cluster

    sm is the list rung and the default; md rides UI text and is what the info panel header uses.

    — In a list

    The case the primitive exists for. Five kinds of thing, one column: the dots carry the answer before any of the names have been read.

    • Star Mizarmag 2.2
    • Galaxy M 51Whirlpool
    • Asterism The Big Dipper7 stars
    • Planet Jupitermag −2.4
    • Meteor shower Perseidspeaks 12 Aug

    — skyTypeFor()

    Call sites never hand-pick an id from a kind string. skyTypeFor(kind, subtype) translates the engine's selection kinds and the deep-sky catalogue's free-text class exactly once, so the catalogue's vocabulary cannot be re-interpreted differently on two pages.

    kindsubtype→ typepill
    star star Star
    star double double-star Double star
    star variable variable-star Variable star
    dso galaxy galaxy Galaxy
    dso planetary nebula planetary-nebula Planetary nebula
    dso globular cluster globular-cluster Globular cluster
    dso open cluster cluster Open cluster
    dso supernova remnant nebula Nebula
    body sun sun The Sun
    body moon moon The Moon
    body mars planet Planet
    region constellation Constellation
    asterism asterism Asterism

    When to use

    Wherever an object's kind is shown: search results, the Tonight list, the archive, the info panel header, related-object links. If you are about to write a <span> with a border and the word "Galaxy" in it, this is that span.

    When not to

    It is not a status badge and not a tag. A pill whose tone is chosen by the caller is a different component; this one's whole contract is that the type decides. For a filter chip the reader can toggle, use a Toggle — a pill is never interactive.