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
Property | Type | Default | Required | Description |
---|---|---|---|---|
as | ElementType | 'span' | No | Allows changing the rendered HTML tag (e.g., span, p, h1). |
children | ReactNode | - | Yes | The content for the Caption component. |
className | String | - | No | Allows extending the class names of the Caption component. |
color | ChameleonCssToken | - | No | Allows changing the color of the component through the use of a CSS Custom Property. (e.g. 'var(--color-primary-base)') |
font | 'default' | 'alt' | 'default' | No | Changes the font style of the Caption. |
size | 'sm' | 'lg' | 'lg' | No | Changes the size of the Caption. |
weight | 'default' | 'strong' | 'default' | No | Changes the font weight of the Caption. |