Plugin · Learn

Pills

A label with a shape and a color, set right inside your sentence.

Write {LIVE} in inline code and Lattice draws a pill. Add a shape or a color word and it becomes a tag, a chevron or a numbered badge: {BETA, tag, c4}. A pill sizes itself from the text around it, so the same pill fits a heading, a bullet and a caption without you picking a size. Pills are part of how Lattice draws a slide, so this plugin is always on.

You write
`{label, words}` in inline code
Draws with
Lattice's own drawing
Surfaces
Every one — drawn at render time
Loaded
Always. Part of every deck

The problem

A slide lists four workstreams. The reader’s next question is which are done, which are stuck and which have not started. Writing “(done)” after each one makes the list read like a form, and coloring a whole row says nothing in a black-and-white printout.

  • Plain words in a row are easy to skip, and they all look alike.
  • A colored row costs the reader the text’s contrast, and the color alone carries the meaning.
  • A pasted label image doesn’t take the theme’s colors and doesn’t resize with the text.

What you want is a small, named label with its own shape and color, set right where the status is.

The idea

  • A label in braces. `{STABLE}` is a capsule. Add words in any order to change it: a shape (tag, chip), a color (c1 to c12) or a size (sm, lg).
  • The shape carries meaning too. A circle is a count, a chevron is a step or a direction, a diamond is a decision. The shape still reads when the color doesn’t.
  • It sizes itself. A pill takes its size from the text around it, so one pill fits a heading, a bullet and a caption.
  • The deck’s colors. c1 to c12 are the same slots the charts and sparks use. A slot picks contrast and never meaning.
  • Always on. Pills are part of how Lattice draws a slide, so there is nothing to turn on, and nothing can turn them off.

How to use it

Pills are on in every deck. Write one in inline code. The label comes first, then any words, in any order:

Shipped and load-tested `{STABLE, c2}`
WordDoes
pill (the default), chip, tag, tag-borderedThe shape of the label
circle, diamondA round or pointed badge for one character or a number
chevron-right, chevron-leftA pointed label that shows a direction
c1 … c12The color, from the deck’s chart palette
sm, lgA step smaller or larger than the text around it
icon=nameA drawn icon beside the label, when the icons plugin knows the name

Each word can also be written by name: {BETA, shape=tag, color=c4} is {BETA, tag, c4}. A label with a comma or a | goes in quotes: {"Cost, excluding tax"}. To show the braces themselves, put a backslash in front: `\{LIVE}`.

In the Studio, type `{ for a menu of starter pills. After a comma, the menu offers only the words that fit next.

Where else it fits

Anywhere a row, a heading or a line has a state: a ledger of workstreams, a status next to a heading, a step number, a count, a tag on a figure caption.

How Lattice uses it

Pills are part of every slide, so no slide type has to ask for the plugin. The colors are slots, not names: c2 is a different hue on every theme, so a slot picks contrast and never meaning. Use a pill’s words, not its color, to say what it means.

What it doesn’t do

  • It has no off switch. Pills are always on. A plugin list, a host setting or a --disable-plugin option cannot turn them off, and naming one as disabled is an error.
  • It doesn’t guess. An unknown or repeated word leaves the span as plain code, and the deck linter says why. { ok, scene } with padded braces is code.
  • It isn’t a status system. The label and the color mean what you write. Lattice does not check that {STABLE} is green.
  • Circles and diamonds hold one character or a number up to two digits. Longer text makes an oval, and the linter points you to tag or chip.