Skip to main content

PickCard

BasicLayout<co-pick-card>

PickCard is a large selectable card for choosing one option on phones, portal and kiosk (appointment, provider, reason).

import { PickCard } from 'health-components';

Examples​

Showcase​

Storybook

Choose One​

Storybook

Disabled​

Storybook

Usage​

<PickCard title="Thu 10/09 9:20 AM" meta="Follow-Up with Dr. Bell" selected onClick={pick} />

When to use​

  • Touch choices with two lines of detail.

When not to use​

  • Dense lists: RadioGroup.

Variants and states​

VariantWhat it is
selectedPrimary border and tint.
disabledFaded.

Accessibility​

  • aria-pressed.

Do and don't​

  • Do: Use for 2 to 6 options.
  • Don't: Hide what differs between cards.

Props​

PropTypeDefaultDescription
title *string—Main line, e.g. "Thu 10/09 9:20 AM"
metastringnoneSecond line (visit type, provider, place)
selectedbooleanfalseChosen; sets aria-pressed
disabledbooleanfalseNot available ("Fully booked")
childrenReactNodenoneExtra content under the meta line

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, name, value, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-pick-card>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-pick-card title="…" meta="…" [defaultValue]="defaultValue">…</co-pick-card>
KindNameDescription
attributetitleMain line, e.g. "Thu 10/09 9:20 AM"
attributemetaSecond line (visit type, provider, place); default none
attributeselectedChosen; sets aria-pressed; default false
attributedisabledNot available ("Fully booked"); default false
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
attributename
property / JSON attributevalue
slot(default)Extra content under the meta line; default none