You are currently viewing outdated (<=3.x) Chameleon documentation on our old website. For version >=4.x, check out our new website.

Current release: 3.5.0 | hub

components

Caption (code)

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

Picture taken by a cameraman

import { Caption } from '@mediahuis/chameleon-react'

Props

NameTypeDefaultRequiredDescription
asFunctionStringNodeObject'p'-Change the rendered HTML tag e.g. span, p, h1
childrenNode-trueContent for component *required
classNameString--Extend classNames.
colorString--Changes the Caption's color, choose one of the tokens.
decoration'inherit''none''underline''line-through''none'-Sets the css text-decoration property.
fontFamily'inherit''primary''secondary''system''system'-Sets the css font-family property.
fontStyle'inherit''normal''italic''oblique'--Sets the css font-style property.
fontWeight'inherit''regular''medium''bold''regular'-Sets the css font-weight property.
level121-Maps token scale to font-size and line-height
style{}--Extend style.
textAlign'inherit''left''right''center''justify''inherit'-Sets the css text-align property.
textTransform'inherit''none''capitalize''uppercase''lowercase'--Sets the css text-transform property.

System Props

System Props

Next to the properties listed in the propstable, a collection of system props can be added to any component for further general styling and layouting purposes. These props vary per component.

To read more about the system, click here to check out its dedicated page.

Color

default: colorBlackBase

You can change the caption's color by passing in a defined color name.

A title or brief explanation accompanying an illustration, cartoon, or poster

A title or brief explanation accompanying an illustration, cartoon, or poster

Decoration

default: none

Controls the text-decoration css attribute.

A title or brief explanation accompanying an illustration, cartoon, or poster

A title or brief explanation accompanying an illustration, cartoon, or poster

A title or brief explanation accompanying an illustration, cartoon, or poster

FontFamily

default: system

Font-families can be used to discern between multiple uses of a Caption.

A title or brief explanation accompanying an illustration, cartoon, or poster

A title or brief explanation accompanying an illustration, cartoon, or poster

A title or brief explanation accompanying an illustration, cartoon, or poster

FontWeight

default: regular

Controls the font-weight css attribute. Only 3 values are available. If a value is missing, it will fallback on the more bold weight.

A title or brief explanation accompanying an illustration, cartoon, or poster

A title or brief explanation accompanying an illustration, cartoon, or poster

A title or brief explanation accompanying an illustration, cartoon, or poster

A title or brief explanation accompanying an illustration, cartoon, or poster

Level

default: 1

Captions of lower importance can be displayed by altering the level prop.

A title or brief explanation accompanying an illustration, cartoon, or poster

A title or brief explanation accompanying an illustration, cartoon, or poster

TextAlign

default: inherit

Controls the css text-align attribute.

Inherit.

Left.

Right.

Center.

Justify Justify Justify Justify Justify Justify Justify Justify Justify Justify Justify Justify Justify Justify.

© Copyright 2020 Mediahuis NV. All rights Reserved