Skip to main content

Paragraph: React

Paragraph is meant for a distinct section of a piece of writing, usually dealing with a single theme

Installation

Before you can start using the @mediahuis/chameleon-react component, you’ll need to install it, for more information check: Getting started for developers.

With that done, you’re now ready to implement the component in your application.

import { Paragraph } from '@mediahuis/chameleon-react';

export default function Example() {
return <Paragraph>Example</Paragraph>;
}

Properties

PropertyTypeDefaultRequiredDescription
asElementType'p'NoAllows rendering the component with a different HTML element.
childrenReactNode-YesThe content for the Paragraph component.
classNameString-NoAllows extending the class names of the Paragraph component.
colorChameleonCssToken-NoAllows changing the color of the component through the use of a CSS Custom Property. (e.g. 'var(--color-primary-base)')
dropcapBoolean-NoAdds a dropcap visual
font'default' | 'alt''default'NoThe font style of the Paragraph.
size'sm' | 'lg''sm'NoThe size of the Paragraph.
weight'default' | 'strong''default'NoThe font weight of the Paragraph.

color

The color property alters the color of the Paragraph component. The values are color tokens such as color-primary-base. For more detailed information, refer to the Color section in the documentation.