Skip to main content

Caption: React

A Caption is meant to be an extra textual illustration of a concept.

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 { Caption } from '@mediahuis/chameleon-react';

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

Properties

PropertyTypeDefaultRequiredDescription
asElementType'span'NoAllows changing the rendered HTML tag (e.g., span, p, h1).
childrenReactNode-YesThe content for the Caption component.
classNameString-NoAllows extending the class names of the Caption component.
colorChameleonCssToken-NoAllows changing the color of the component through the use of a CSS Custom Property. (e.g. 'var(--color-primary-base)')
font'default' | 'alt''default'NoChanges the font style of the Caption.
size'sm' | 'lg''lg'NoChanges the size of the Caption.
weight'default' | 'strong''default'NoChanges the font weight of the Caption.