Skip to main content
Every Forme component accepts a style prop with CSS-like properties. Styles are passed as a JavaScript object.
Prefer Tailwind syntax? Use @formepdf/tailwind to write tw("flex-row gap-3 p-4 bg-slate-50") instead of style objects.

Layout

Layout examples

Spacing

Margins in Forme are always additive (like flexbox gap). There is no CSS margin collapsing.

Spacing examples

Typography

Typography examples

Background and Border

Background and border examples

Positioning

Positioning examples

Page Behavior

Page behavior examples

Style Inheritance

Some properties are inherited from parent elements, matching CSS behavior: Inherited: color, fontFamily, fontSize, fontWeight, fontStyle, lineHeight, textAlign, letterSpacing Not inherited: width, height, padding, margin, backgroundColor, borderWidth, borderColor, borderRadius, flexDirection, gap, opacity