- Implementation
- SelectCard Props
- SelectCard.Group Props
Common Examples
SelectCard Components
The Anvil2SelectCard is typically used within a SelectCard.Group. Under the hood SelectCard can either be a radio or a checkbox, and accepts all of the props associated with those HTML inputs.SelectCard.Group: the parent component used to configure a group ofSelectCarditems.SelectCard: used to create a card input to use with a group.
Validation
SelectCards have an errored state, which can be triggered with an onChange.Select Indicator Visual
Use theshowSelectIndicator prop to display a checkbox or radio indicator in a separate column on the left side of the card. The indicator type is automatically determined by the selectionMode from SelectCard.Group.The
showSelectIndicator prop is available for both SelectCard and SelectCard.Group, but in most cases it is recommended to use it with SelectCard.Group to show the indicator on all cards in the group.Controlled State
Usevalue on SelectCard.Group to control the selection externally. The component will not update its selection on its own — you must update value in the onChange callback.Default Selection
UsedefaultValue to pre-select cards when the group is uncontrolled. The selection can still be changed by the user after the initial render.