Skip to content
Typography

TypographyStylesProvider

server23 kB

Gives the catalogue's type scale to HTML you did not write.

@stellaria/nebula-webTypographyStylesProviderProps

Preview

Markup that arrives as a string — from a CMS, from Markdown, from a rich text editor — carries none of your classes. Its h2, p, ul and blockquote render with the browser defaults, which match nothing else on the page.

TypographyStylesProvider styles that subtree from the theme: sizes, line heights, the space between blocks, lists and quotes. It is the one place where a bare tag selector is the right tool, and it is scoped so it never leaks past its own children.

tsx
<TypographyStylesProvider>
  <div dangerouslySetInnerHTML={{ __html: article.body }} />
</TypographyStylesProvider>

For content you do write, use Title, Text and List: they carry the same scale and they are typed.

Props

4
PropTypeDefault

children

ReactNode

—

className

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

string

—

component

(ElementType & C)

—

reveal

Animates the element in when it first scrolls into view. `true` takes the catalogue entrance; an object tunes it — `preset`, `distance`, `spring`, `duration`, `once`, `amount`, `rootMargin` and `index` for a stagger. It lives here rather than on each surface so that `Card`, `Paper`, `GradientBorder`, `Section` and anything else built on `Box` inherit one implementation. Without it `Box` stays a server component; with it the root swaps for a client shell and the children keep rendering on the server. The entrance is a CSS transition, not a JavaScript animation: it is the only motion in the catalogue that fires WHILE the user scrolls, and the compositor should own it.

boolean | UseRevealOptions

—

Also accepts

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

Style props · 128