InputCard
Primitive selectable card used as the base for RadioCard and CheckboxCard.
Purely presentational — the parent owns selected and click handling.
Selection and disabled states are exposed as data-selected/data-disabled
for styling.
Terrazzo — Veneto
Marble — Carrara
Usage
import { getInputCardIconSize, INPUT_CARD_ICON_SIZE, InputCard, inputCardBaseStyles, InputCardIcon, InputCardProps, inputCardSelectedStyles, inputCardSizeStyles } from "@desk/ui/components/input-card";Best practices
InputCardis a presentational primitive — the parent ownsselectedand click handling; for real form semantics useRadioCardGroup/CheckboxCardGroup, which build on it.Drive the selected look via the
selectedprop (it setsdata-selected+ the primary tint), not by appending your own active classes.Use
asChildto project the card styling onto a real interactive element (e.g. a<label>wrapping an input) when you need native selection behavior.
Props
InputCard
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | Merge props onto child | |
| disabled | boolean | Whether disabled | |
| selected | boolean | Selected state; drives the primary-tinted styling and the | |
| size | "base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" | Component size |
InputCardIcon
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | ||
| icon | LucideIcon | React.ComponentType<React.SVGProps<SVGSVGElement>> | ||
| selected | boolean | ||
| size | "base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" |
Also exports
- const
getInputCardIconSize - const
INPUT_CARD_ICON_SIZE - const
inputCardBaseStyles - interface
InputCardProps - const
inputCardSelectedStyles - const
inputCardSizeStyles
Composition
Builds on
Used by