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

Choice (code)

A visual alternative to radio buttons and checkboxes. They allow a selection of single or multiple options from a set of predefined options.

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

Props

NameTypeDefaultRequiredDescription
checkedBoolean--Whether the choice is checked or not.
childrenNode--Contents displayed within the choice, when it's selected.
classNameString--Extend classNames.
disabledBoolean--Visually and functionally disables the choice.
idString-trueThe id given to the input, also adds htmlFor to the label.
imageAltString--The alt text of the image.
imageSrcString--The source of the image. -> The image must be: width: space-10, height: space10!
infoStringNode--Info text.
labelPropsObject--The props for the wrapping label.
messageStringNode--message text.
nameString-trueNative input name.
onChangeFunction--The value of the choice changes. returns native onchange event.
titleStringNode-trueTitle text.
type'radio''checkbox''radio'-Native input type.
valueString-trueNative input value.

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.

Message

default: undefined

The message is meant as a sort of subtitle.

Children

default: undefined

The content only shown when a specific choice is checked.

Disabled

default: false

Marking a Choice disabled, will disable all interaction with the element.

Image

default: undefined

Visually provide extra information to the choice by passing an image, please don't forget the alt.

Info

default: undefined

Provide additional context to the Choice.

Title

default: undefined

What's this Choice all about?

Type

default: radio

Switch between radio and checkbox functionallity.

© Copyright 2020 Mediahuis NV. All rights Reserved