Card is a container for text, photos, and actions in the context of a single subject.
NextUI exports 4 card-related components:
- Card: The main component to display a card.
- CardHeader: Commonly used for the title of a card.
- CardBody: The content of the card.
- CardFooter: Commonly used for actions.
See the Divider component for more details.
You can pass the
isFooterBlurred prop to the card to blur the footer.
You can use other NextUI components inside the card to compose a more complex card.
You can pass the
isBlurred prop to the card to blur the card.
If you pass the
isPressable prop to the card, it will be rendered as a button.
Note: that the used callback function is
onClick. Please see the usePress component for more details.
You can use
Image component as the cover of the card by taking it out of the
Card has the following attributes on the
- data-hover: When the card is being hovered. Based on useHover
- data-focus: When the card is being focused. Based on useFocusRing.
- data-focus-visible: When the card is being focused with the keyboard. Based on useFocusRing.
When the card is disabled. Based on
- data-pressed: When the card is pressed. Based on usePress
|children||Usually the Card parts, ||-|
|shadow||The card shadow.|
|radius||The card border radius.|
|fullWidth||Whether the card should take the full width of its parent.|
|isHoverable||Whether the card should change the background on hover.|
|isPressable||Whether the card should allow to be pressed.|
|isBlurred||Whether the card background should be blurred.|
|isFooterBlurred||Whether the card footer background should be blurred.|
|isDisabled||Whether the card should be disabled. The press events will be ignored.|
|disableAnimation||Whether to disable the animation.|
|disableRipple||Whether to disable ripple effect. Only when |
|allowTextSelectionOnPress||Whether to allow text selection on pressing. Only when |
|classNames||Allows to set custom class names for the card slots.||-|
|onPress||Handler that is called when the press is released over the target.|
|onPressStart||Handler that is called when a press interaction starts.|
|onPressEnd||Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.|
|onPressChange||Handler that is called when the press state changes.|
|onPressUp||Handler that is called when a press is released over the target, regardless of whether it started on the target or not.|