Skip to main content

RadioCard

Library
UDS Base
Repository
github.com/telus/universal-design-system
Package
npmjs.com/package/@telus-uds/ds-allium
Package version
1.14.0
Loading...

Introduction

import { RadioCard } from '@telus-uds/ds-allium'

A RadioCard is a Card that, when part of a RadioCardGroup, may be selected like a radio button.

Guidance

caution

In most cases, RadioCardGroup should be used instead of using RadioCard directly.

Pass the RadioCardGroup an items array and it will render RadioCards for each item in the array with appropriate accessibility props, web form tags and state management.

Use RadioCard where a user needs to make one selection out of a selection, and where each option requires some detailed information.

Accessibility

RadioCard component accepts all the common accessibility props, but also sets some defaults, including accessibility role 'radio' and accessibility state that depends on the other props (checked, inactive) or the internal state in case of uncontrolled RadioCard.

Platform considerations

The component is available on both native platforms and web.

Props

NameTypeDefaultDescription
checkedboolUse 'checked' for controlled Radio. For uncontrolled Radio, use the 'defaultChecked' prop.
childrennode | funcAdditional content to be displayed below the button.
defaultCheckedboolUse 'defaultChecked' to provide the initial value for an uncontrolled Radio.
descriptionstringAn optional radio button description.
errorboolWhether the underlying input triggered a validation error or not.
idstringRadio card button ID.
inactiveboolWhether the corresponding input is disabled or active.
labelstringThe label.
namestringAssociate this radio card with a group (set as the name attribute).
onChangefuncCallback called when a controlled radio card gets interacted with.
titlestringContent to be displayed at the top of the card alongside the radio button
tokenscustomSystem tokens prop, see tokens for more details
valuestring | number | boolThe value. Must be unique within the group.
variantobjectOfSystem variant prop, see variants for more details

Tokens

In exceptional circumstances, the following tokens can be passed to this component to override its default styles. Do not do this unless absolutely necessary. Read more about overriding styles.

View Tokens
Prop NameToken PropertyToken Type
tokensouterBorderColorcolor
outerBorderWidthborder
outerBorderGapsize
flexinteger
backgroundColorcolor
borderColorcolor
borderRadiusradius
borderWidthborder
paddingBottomsize
paddingLeftsize
paddingRightsize
paddingTopsize
minWidthsize
shadowshadow
radioCheckedBackgroundColorcolor
radioCheckedSizesize
radioInputBackgroundColorcolor
radioInputBorderColorcolor
radioInputBorderWidthborder
radioInputOutlineColorcolor
radioInputOutlineWidthborder
radioInputSizesize
radioOuterBorderColorcolor
radioOuterBorderWidthborder
radioOuterBorderGapsize
fontSizefontSize
fontNamefontName
lineHeightlineHeight
colorcolor
letterSpacingletterSpacing
textTransformtextTransform
fontWeightfontWeight
radioSpaceinteger
contentSpaceinteger

Figma

Variants

This component does not have any stylistic variants.

Feedback