Paragraph
For large blocks of text with multiple lines of wrapping.
- Install
npm install @pluralsight/ps-design-system-text
- Import
import { P } from '@pluralsight/ps-design-system-text'
Examples
Sizes
Three text sizes are available using the size
prop.
import { P } from '@pluralsight/ps-design-system-text'import React from 'react'const Example: React.FC = props => {return (<React.Fragment><P size={P.sizes.large}><strong>Paragraph - large</strong> - Lorem ipsum dolor sit ametadipisicing elit, sed do eiusmod tempor incididunt ut labore et doloremagna aliqua. Ut enim ad minim veniam, quis nostrud exercitation nisi utaliquip ex ea commodo consequat. Lorem <em>ipsum dolor sit</em> ametconsectetur adipisicing elit, sed do eiusmod tempor incididunt ut laboreet dolore magna aliqua.</P><P size={P.sizes.normal}><strong>Paragraph - normal</strong> - Lorem ipsum dolor sit ametadipisicing elit, sed do eiusmod tempor incididunt ut labore et doloremagna aliqua. Ut enim ad minim veniam, quis nostrud exercitation nisi utaliquip ex ea commodo consequat. Lorem <em>ipsum dolor sit</em> ametconsectetur adipisicing elit, sed do eiusmod tempor incididunt ut laboreet dolore magna aliqua.</P><P size={P.sizes.small}><strong>Paragraph - small</strong> - Lorem ipsum dolor sit ametadipisicing elit, sed do eiusmod tempor incididunt ut labore et doloremagna aliqua. Ut enim ad minim veniam, quis nostrud exercitation nisi utaliquip ex ea commodo consequat. Lorem <em>ipsum dolor sit</em> ametconsectetur adipisicing elit, sed do eiusmod tempor incididunt ut laboreet dolore magna aliqua.</P></React.Fragment>)}export default Example
Colors
Text color can be set to Primary (high contrast) or Secondary (medium contrast) using the color
prop.
import { P } from '@pluralsight/ps-design-system-text'import React from 'react'const Example: React.FC = props => {return (<React.Fragment><P color={P.colors.primary}><strong>Paragraph - primary</strong> - Lorem ipsum dolor sit ametadipisicing elit, sed do eiusmod tempor incididunt ut labore et doloremagna aliqua. Ut enim ad minim veniam, quis nostrud exercitation nisi utaliquip ex ea commodo consequat. Lorem <em>ipsum dolor sit</em> ametconsectetur adipisicing elit, sed do eiusmod tempor incididunt ut laboreet dolore magna aliqua.</P><P color={P.colors.secondary}><strong>Paragraph - secondary</strong> - Lorem ipsum dolor sit ametadipisicing elit, sed do eiusmod tempor incididunt ut labore et doloremagna aliqua. Ut enim ad minim veniam, quis nostrud exercitation nisi utaliquip ex ea commodo consequat. Lorem <em>ipsum dolor sit</em> ametconsectetur adipisicing elit, sed do eiusmod tempor incididunt ut laboreet dolore magna aliqua.</P></React.Fragment>)}export default Example
Props
Name | Type | Description | Default |
---|---|---|---|
size |
| Text size (from P.sizes) | medium |
color |
| Text color (from P.colors) | primary |
children | React.ReactNode |
|