- Implementation
- Card Props
Common Examples
Cards are used to distinguish sections of content within a page, and can be interactive (clickable).Background Color
Use thebackground prop to control the background color of the card.Padding
Anvil provides five options to pass to thepadding prop to determine the spacing between the card border and content.Flex Direction
Use theflexDirection prop to determine which direction the children are displayed. The parent div of an Anvil Card uses display: inline-flex, so note that the orientation of the children could vary based on the user’s locale and settings.Creating sections with Divider
To create sections within aCard, use a padding of 0 along with the Divider, then give each child element its own padding as needed.Interactive Cards
If the card needs to have an action applied to it, please use the InteractiveCard component instead.React Accessibility
- Since the
Cardcomponent can accept any valid HTMLdivprops, all relevantaria-*props are supported. - When creating an interactive card, the
ButtonCompoundcomponent wraps the rendered card in abuttonelement, and will use the content of the card to determine its label. If the card includes complex content, it may be helpful to usearia-labelledbyoraria-label. Always test using a screenreader to ensure the label makes sense and doesn’t repeat information.




