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

IconButton (code)

IconButtons are specific instances of a Button, where the only content is an Icon.

import { Brand } from '@mediahuis/chameleon-theme-wl/icons'
import { IconButton } from '@mediahuis/chameleon-react'

Props

NameTypeDefaultRequiredDescription
accessibilityLabelString--Accessible friendly label. Will not be shown
appearance'default''primary''secondary''plain''outline''default'-Controls the button’s background, text, and border color.
asFunctionStringNodeObject'button'-Render with a different HTML tag or a different custom component.
circularBoolean--Display as a circular or not.
classNameString--Extend classNames.
colorString--Changes the IconButton's color, choose one of the tokens. NOTE: The color prop is only used with appearance `default`.
disabledBoolean--Visually and functionally disables the button.
iconFunctionNodeObject--The icon rendered inside the IconButton (passed to Icon as), choose one of the icons package.
onClickFunction--Fires when the IconButton is clicked on.
size'small''large''large'-Changes the button's height and width.
flexShrink0--

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.

Appearance

default: default

Just like a regular Button, an IconButton has several variations for its appearance.

import { Brand } from '@mediahuis/chameleon-theme-wl/icons'
import { IconButton } from '@mediahuis/chameleon-react'

Icon

default: Placeholder

Changing the contained Icon can be done by altering the icon prop.

import { Brand, Checkmark, TagFill, Add } from '@mediahuis/chameleon-theme-wl/icons'
import { IconButton } from '@mediahuis/chameleon-react'

Circular

default: false

An IconButton is either contained in a square or in a circle.

import { Brand } from '@mediahuis/chameleon-theme-wl/icons'
import { IconButton } from '@mediahuis/chameleon-react'

Size

default: large

IconButtons come in two sizes, large and small.

import { Brand } from '@mediahuis/chameleon-theme-wl/icons'
import { IconButton } from '@mediahuis/chameleon-react'

Disabled

default: false

To indicate to a user that an IconButton can not be interacted with, add the disabled prop.

import { Brand } from '@mediahuis/chameleon-theme-wl/icons'
import { IconButton } from '@mediahuis/chameleon-react'

© Copyright 2020 Mediahuis NV. All rights Reserved