Label
A short read-only text badge for a status, a category or metadata. Its background and ink come from the theme's
semantic palette.
Data Display
When to use
Usage
defaultinfosuccesswarningdanger
import { Label } from '@apollion-dsi/core/elements/label';
<Label variant="success" text="Approved" />;variant picks the palette: the light tone fills the badge and the action tone sets the ink. children wins over
text.
Inverted
On dark or photographic surfaces the light fill disappears. inverted fills with the action tone and derives the ink
by contrast (AA in any theme). To invert a whole subtree, use surface on the container
(surface inversion).
defaultsuccessdanger
<Label inverted variant="success" text="Live" />
Status
status draws a small StatusDot before the text. The dot is decorative, so say the state
in the text. It reads best on the default tonal fill. Status meanings: Chip › Status.
idleliverunningsync failed
<Label status="working" variant="info" text="running" />
Playground
loadingAccessibility
- A
Labelis text: screen readers read it inline. Write the meaning in the text, not in the colour alone. - The status dot is
aria-hidden.
Properties
Name
Type
Default
Description
alignContent"center""start""end""between""around""evenly""stretch"nonePacking of wrapped lines / grid tracks on the block axis.
asElementTypenoneOverrides the HTML tag resolved by the `variant` — the look of one,
the semantics of another. Also defines which HTML attributes apply.
@example ```tsx
<Text variant="h1" as="h2">Visually h1, semantically h2</Text>
```
childrenReactNodenoneBadge content via children. Takes precedence over `text`.
colorstringnoneTheme token (`theme.colors`) used as `color`. Has lower precedence than
`contrast`: when both are provided, the contrast calculation wins.
Stays `string` (not the typed union): `color` is also an HTML attribute
(`<li color>`, etc.) and interfaces extending native props require
identical types on the name collision.
containmentstringnoneContainment marker for the `cq` channel: emits
`container-type` (+ `container-name` when the string form carries one,
e.g. `'inline-size card'`). Apply on the immediate wrapper of the
adapting component — NEVER on page-level shells.
cqPartial<Record<ContainerSizeTypes, ContainerQueryable>>noneContainer-relative styles per `theme.containerSizes` key.
enableBreakpoint"xs""xl""sm""md""lg"noneForces a prop set to apply as if the given breakpoint were active,
regardless of the actual viewport size. Useful for stories/storyshots or
controlled previews.
htmlForstringnoneForwarded to `htmlFor` when the final tag is a `<label>` (via
`as="label"`). Declared here — and not only via `as="label"` — to keep
the prop available when `Text` is used without a literal `as` (e.g.
`Partial<TextInterface>` in `labelProps`).
ignoreResponsivebooleannoneWhen `true`, fully disables the responsive factory (useful in tests or
in components that want to show a single fixed snapshot).
invertedbooleanfalseStrong-background variant of the badge: fill goes to the palette's
`action` tone, ink derives by contrast (AA in any theme). For dark or
photographic surfaces.
justifyItems"center""start""end""stretch"noneGrid containers: inline alignment of every item in its cell.
legibility"on-photo"noneReading-shadow preset for text over a photographic background
(`on-photo`). Replaces the inline `style={{ textShadow }}` in the
consumer (brasil_2030 radar, gap A3). Token emission is deferred until a
2nd consumer asks for the raw var (see backlog).
lineClampnumbernoneCaps the text at this many lines and ends the cut with an ellipsis.
The full string stays in the DOM.
motion"none""fade""scale""slide-up""slide-down""slide-left""slide-right""collapse""sheet""sheet-top""drawer-left""drawer-right""push-left""push-right"noneSemantic motion preset. Enter animates on mount via
`@starting-style`; exit expects the `data-state="closing"` attribute
(see `useExitTransition`). Durations/easings resolve from the
`--apollion-motion-*` vars with the theme literal as fallback, so
`prefers-reduced-motion` zeroes them centrally.
@example ```tsx
<Flex motion="slide-up">Toast body</Flex>
<Flex motion="push-left">Editor page</Flex>
```
pageShellbooleannoneCenters the element and caps the width at `theme.layout.pageMaxWidth`.
The page shell of a classic centered layout.
placeItems"center""start""end""stretch"noneGrid containers: `place-items` shorthand (block + inline).
readablenumberbooleannoneMakes the `color` legible against the page surface: `true` = WCAG AA
(4.5), a number sets a custom floor. Ignored with `contrast`.
See the Layout Props concept page for the full semantics.
status"info""success""warning""danger""neutral""live""working"noneDraws a `StatusDot` (small) before the text — the state the badge names
("live", "running", "sync failed"). The dot is decorative: the badge text
carries the meaning, so say the state in it. `live` and `working` move
on the theme's indicator channel. Reads best on the default tonal fill.
textstringnoneBadge content as a string.
ticknumbernoneLive value driving a tick flash. When it changes, the glyph color snaps
to `success` (went up) or `danger` (went down) and then eases back to
the idle ink over `theme.animation.transitions.settle`. Only the color
moves — layout is untouched. Leave it unset for static text.
@example ```tsx
<Text tick={lastPrice} text={formatted} />
```
transformstringnoneCSS `transform` value (e.g. `translate(-50%, -33px)`). Never leaks
to the DOM as an attribute.
type"auto""mobile""desktop"'auto'Responsive mode (see {@link TextType}). Use `'auto'` in most cases.
variant"default""info""success""warning""danger"'default'Semantic color of the badge. Each value maps to a theme palette
(`light` for the background, `action` for the text).
viewportMediasPartial<Record<keyof BreakPoint<any>, ContainerQueryable>>noneViewport-driven styles per `theme.breakpoints` key, object grammar — the
viewport sibling of `cq` (see {@link ViewportMediaStyles}).
Besides the props above, every component accepts the layout props (spacing, color, flex/grid, sizing, border) — not repeated here.