Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

Text

Text(props): Element

Parameter Type Description
props { aria-label?: string; as?: ElementType<TextElementProps>; children: ReactNode; className?: string; size?: "base" | "xs" | "sm" | "lg" | "xl"; style?: CSSProperties; tabular?: boolean; title?: string; } -
props.aria-label? string The accessible name, where the element the caller chose takes one. Spelled as the attribute it becomes, so there is no second name for a caller to learn and none for this to quietly drop.
props.as? ElementType<TextElementProps> The element to draw. Rows of named values are a list, one value is an output, and a span is the fallback for text that is only text. A wrapper of this component’s own would be an element with nothing to say, so the caller’s is the one that is drawn.
props.children ReactNode -
props.className? string An override that shows in the diff.
props.size? "base" | "xs" | "sm" | "lg" | "xl" The font size, from Tailwind’s scale. Small by default, the size of a readout over the world.
props.style? CSSProperties A style that comes from data, such as an item’s rarity colour or a place on a grid. A look that is the same every time is a class.
props.tabular? boolean Draws every digit the same width, so a number that counts does not shift the text beside it or the pane around it.
props.title? string What the browser shows in a tooltip while the pointer rests on it, such as what a stat does.

Element