Bold weight paragraph
Underline paragraph
Italic paragraph
import { P } from '@dnb/eufemia/elements'
Paragraphs are block-level elements, used to structure and format text contents.
Paragraph has some default typography styling even without any properties being set.
Read more about Fonts in the Designer Guides.
Both Paragraph and the Span component have the same typography properties that uses the typography helper classes.
These are the standard available modifiers for paragraph typography:
As well as some other modifiers.
Default paragraph
Regular weight paragraph (same as default)
Medium weight paragraph
Also automatically sets the matching line-height (line property).
x-small paragraph
small paragraph
medium paragraph
basis paragraph (same as default)
large paragraph
x-large paragraph
xx-large paragraph
Right aligned paragraph
Center aligned paragraph
Left aligned paragraph
Basis family paragraph (same as default)
Heading family paragraph (only different on some themes)
Monospace family paragraph
Line-height will be set automatically based on the size properties, but can also be set separately if needed.
x-small line-height paragraph
small line-height paragraph
medium line-height paragraph
basis line-height paragraph (same as default)
large line-height paragraph
x-large line-height paragraph
xx-large line-height paragraph
Although bold, italic and underline are not a standard part of the Eufemia design system for typography (in particular, "medium" should be used instead of "bold"), we still include them as an option for convenience. And there are also cases where an accessibility case can be made for their use.
Bold weight paragraph
Underline paragraph
Italic paragraph
The proseMaxWidth prop allows you to limit the width of paragraph text based on character count, creating optimal reading line lengths:
This is a regular paragraph without any width constraints. It will extend to the full width of its container.
This paragraph uses proseMaxWidth=60 to limit its width to approximately 60 characters.
This paragraph uses proseMaxWidth=40 for an even narrower reading width.
Use Typography.Provider to apply proseMaxWidth to multiple paragraphs at once:
ReferenceError: Typography is not defined
Paragraph also adds some default styling to child typography HTML elements. Like <b> or <strong>.
basis sizedHere is a paragraph textAnchor / Text LinkBold paragraph (medium weight)Strong paragraph (medium weight)Numbers 0123456789Code paragraphCite paragraphText 1 Text 1 Text 1 Text 1 Text 1 Text 1
small sizedHere is a small paragraph textAnchor / Text LinkBold paragraph (medium weight)Strong paragraph (medium weight)Numbers 0123456789Code paragraphCite paragraphText 1 Text 1 Text 1 Text 1 Text 1 Text 1
Here is a x-small paragraph text
with a new line.
Italic paragraphUnderline paragraphUXDeleted paragraphMarked paragraphInserted paragraphText SuperscriptText Subscript