Skip to content
Typography

Text

server20 kB
@stellaria/nebula-webTextProps

Preview

Props

6
PropTypeDefault

children

ReactNode

className

Composes with the classes `Box` computes instead of replacing them.

string

component

The element it paints. A paragraph by default, so use `component="span"` for text that lives inside a sentence — a `<p>` nested in a `<p>` is invalid markup the browser silently splits.

(ElementType & C)"p"

inherit

Takes family, size, weight and line height from the parent instead of the `Text` defaults. For text that must sit inside a heading or a button without breaking its type.

boolean

lines

Clamps the text to this many lines with an ellipsis. Beats `truncate`, and only applies above zero. Needs a width to work against: inside a flex child, that usually means `miw={0}`.

number

truncate

Cuts the text to a single line with an ellipsis. Ignored when `lines` is set, which does the same thing over several lines. The full text stays in the DOM, so it is still read aloud.

boolean

Also accepts

On top of its own props, this component forwards these groups.

Style props · 128