Skip to main content

RadioCard

Library
UDS Base
Repository
github.com/telus/universal-design-system
Package
npmjs.com/package/@telus-uds/components-base
Package version
1.6.1
Loading...

Introduction

import { RadioCard } from '@telus-uds/components-base'

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.

Props

NameTypeDefaultDescription
titlestringContent to be displayed at the top of the card alongside the radio button
childrenunionAdditional content to be displayed below the button.
checkedboolUse `checked` for controlled Radio. For uncontrolled Radio, use the `defaultChecked` prop.
defaultCheckedboolUse `defaultChecked` to provide the initial value for an uncontrolled Radio.
descriptionstringAn optional radio button description.
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).
errorboolWhether the underlying input triggered a validation error or not.
valueunionThe value. Must be unique within the group.
onChangefuncCallback called when a controlled radio card gets interacted with.
tokenscustomSystem tokens prop, see tokens for more details
variantobjectOfSystem variant prop, see variants for more details