Paragraph
Paragraph class modifiers
Eufemia comes with several styles you can use on paragraphs and other HTML text elements:
Weights
.dnb-p
(Body text).dnb-p--medium
Sizes
.dnb-p--small
.dnb-p--x-small
Variants
.dnb-p--lead
Paragraphs in React
Paragraphs using React JSX.
import { P, Lead } from '@dnb/eufemia'
Default paragraph
Medium weight paragraph
Small paragraph
Small paragraph with medium weight
<div> <P>Default paragraph</P> <P modifier="medium">Medium weight paragraph</P> <P size="small">Small paragraph</P> <P modifier="small medium">Small paragraph with medium weight</P> {/* (Bold is currently not supported by DNB UX) */} {/* <P modifier="bold">Bold weight paragraph</P> */} {/* <P modifier="small bold">Small paragraph with bold weight</P> */} </div>
basis
sized
Paragraphs Here is a paragraph textAnchor / Text LinkBold paragraph (medium weight)Strong paragraph (medium weight)Numbers 0123456789Code paragraph
Cite paragraphText 1 Text 1 Text 1 Text 1 Text 1 Text 1
<P> <Case>Here is a paragraph text</Case> <Case> <Anchor href="/">Anchor / Text Link</Anchor> </Case> <Case> <b>Bold paragraph (medium weight)</b> </Case> <Case> <strong>Strong paragraph (medium weight)</strong> </Case> {/* <i>Italic paragraph (Currently not supported by DNB UX)</i> */} {/* <u>Underline paragraph (Currently not supported by DNB UX)</u> */} <Case>Numbers 0123456789</Case> <Case> <code className="dnb-code">Code paragraph</code> </Case> <Case> <cite>Cite paragraph</cite> </Case> <Case> Text <sup>1</sup>{' '} <b> Text <sup>1</sup> </b>{' '} </Case> <Case> Text{' '} <sup> <Anchor href="/">1</Anchor> </sup>{' '} <b> Text{' '} <sup> <Anchor href="/">1</Anchor> </sup> </b>{' '} </Case> <Case> Text <sub>1</sub>{' '} <b> Text <sub>1</sub> </b>{' '} </Case> </P>
small
sized
Paragraph Here is a small paragraph textAnchor / Text LinkBold paragraph (medium weight)Strong paragraph (medium weight)Numbers 0123456789Code paragraph
Cite paragraphText 1 Text 1 Text 1 Text 1 Text 1 Text 1
Here is a x-small paragraph text
with a new line.
<div> <P size="small"> <Case>Here is a small paragraph text</Case> <Case> <Anchor href="/">Anchor / Text Link</Anchor> </Case> <Case> <b>Bold paragraph (medium weight)</b> </Case> <Case> <strong>Strong paragraph (medium weight)</strong> </Case> {/* <i>Italic paragraph</i> */} {/* <u>Underline paragraph</u> */} <Case>Numbers 0123456789</Case> <Case> <code className="dnb-code">Code paragraph</code> </Case> <Case> <cite>Cite paragraph</cite> </Case> <Case> Text <sup>1</sup>{' '} <b> Text <sup>1</sup> </b>{' '} </Case> <Case> Text{' '} <sup> <Anchor href="/">1</Anchor> </sup>{' '} <b> Text{' '} <sup> <Anchor href="/">1</Anchor> </sup> </b>{' '} </Case> <Case> Text <sub>1</sub>{' '} <b> Text <sub>1</sub> </b>{' '} </Case> </P> <P size="x-small"> <Case> Here is a x-small paragraph text <br /> with a new line. </Case> </P> </div>
Additional Paragraph formatting (not defined yet)
Italic paragraphUnderline paragraphUXDeleted paragraphMarked paragraphInserted paragraphText SuperscriptText Subscript
<P> <Case> <i>Italic paragraph</i> </Case> <Case> <u>Underline paragraph</u> </Case> <Case> <Anchor title="User Experience">UX</Anchor> </Case> <Case> <del>Deleted paragraph</del> </Case> <Case> <mark>Marked paragraph</mark> </Case> <Case> <ins>Inserted paragraph</ins> </Case> <Case> Text <sup>Superscript</sup> </Case> <Case> Text <sub>Subscript</sub> </Case> </P>
Read more about Fonts in the Designer Guides.