OptionCards present the functionality of a radio or checkbox in a more visually prominent card format with an increased click area.
OptionCard, Checkbox, and Radio all let users make single or multiple selections to fill out a form. However, it's important to understand the difference as they are not interchangeable:
When options appear together in a group, keep content structure consistent across all cards. If one card has a title and description, all cards should have titles and descriptions.
Use the default horizontal layout for most option groups, especially when description is important to the card. Vertical layout works best for icon-focused selections where the icon is the primary visual identifier and communication tool, such as choosing a provider or integration.
OptionCard supports custom children alongside or instead of the built-in title and description. Use custom content to include additional elements like status indicators, badges, or structured layouts.
The title and description props cover most use cases.
Pass children to add elements beyond a title and description.
If Pluma icons don't satisfy a use case, custom graphics can be used. The image will adhere to the same positioning and size rules as the standard icon.
Use the icon prop for standard icons from the Pluma icon library.
Use iconSrc for brand logos or illustrations not available in the icon library.
OptionCard supports both Pluma icons and custom images. Icons help users quickly identify options visually, especially in groups.
In horizontal layout with a title, the icon appears to the left of the content, separated by a divider. In vertical layout, the icon appears above the content and the text is centered.
Use a Pluma icon name to display a standard icon from the icon library.
Use an image URL for brand logos or illustrations that don't exist in the icon library.
The OptionCard can be displayed in either horizontal or vertical layouts. Determine which option is best depending on how much available space there is.
In the default horizontal layout, content is left-aligned. When an icon is present, it appears to the left of the content with a divider between them.
Content is center-aligned. When an icon is present, it appears above the content.
The OptionCard is available in two sizes: medium and small.
Medium is the default, used in the majority of cases. Provides more breathing room for titles and descriptions.
Small is preferred for tighter layouts or simpler choices where less visual emphasis is required.
With no user interaction, the OptionCard shows default styles.
On mouse hover, the border color updates to indicate the card is interactive.
On keyboard focus, the card receives the standard 2px focus ring.
Disabled cards cannot be interacted with. The border and text colors are muted to indicate the card is unavailable.
OptionCard supports two selection modes that change how the underlying input behaves:
Radio: This default mode allows only one card to be selected within a group. Similar to radios, cards may not be deselected. Another card must be chosen instead. Use this mode for cases where only one selection is required.
Checkbox: This mode allows multiple cards to be selected independently. Each card can be toggled on and off. Use checkbox mode when users should be able to select zero or more options.
Only one option can be selected at a time. Clicking a selected card does not deselect it.
Multiple options can be selected independently. Clicking a selected card deselects it.
Descriptions provide additional context to the card that cannot be conveyed by the title alone. Keep them to a single short sentence that explain the option's purpose or behavior. End punctuation is not required.
Write titles that clearly name the option being presented. Keep them to one to three words when possible. Use sentence case with no end punctuation.