Card
Usage
Card component is a wrapper around Paper component with context styles for Card.Section component. Combine Card component with other Mantine components to create cards with your design requirements:
Card.Section
Card.Section is a special component that is used to remove Card padding from its children while other elements still have horizontal spacing. Card.Section works the following way:
- It component is a first child in Card then it has negative top, left and right margins
- If it is a last child in Card then it has negative bottom, left and right margins
- If it is in the middle then only left and right margins will be negative
Note that Card relies on mapping direct children and you cannot use fragments or others wrappers for Card.Section:
Custom root element
You can set component
prop on Card to use provide custom root element,
for example, you can make whole card a link:
You can also use React component instead of an element, for example, Link from react-router-dom:
To use custom component with TypeScript provide type:
Custom Card.Section root element
Card.Section root element can be changed the same way as with Card:
Get root element ref
You can get root element ref by setting ref
prop: