3D Card Effect
A card perspective effect, hover over the card to elevate card elements.
Examples
With rotation
API
CardContainer
The CardContainer
component serves as a wrapper for the 3D card effect. It manages mouse events to create a 3D perspective.
Props
Prop Name | Type | Default | Description |
---|---|---|---|
class | String | null | Additional classes for styling the inner container element. |
containerClass | String | null | Additional classes for styling the outer container element. |
Usage
MyCardComponent.vue
CardBody
The CardBody
component is a flexible container with preserved 3D styling. It is intended to be used within a CardContainer
to hold content with a 3D transformation effect.
Props
Prop Name | Type | Default | Description |
---|---|---|---|
class | String | null | Additional classes for custom styling. |
Usage
MyCardComponent.vue
CardItem
The CardItem
component represents individual items within the 3D card. It supports various transformations (translation and rotation) to create dynamic 3D effects.
Props
Prop Name | Type | Default | Description |
---|---|---|---|
as | String | "div" | The HTML tag or component to use for the item. |
class | String | null | Additional classes for styling the item. |
translateX | Number/String | 0 | X-axis translation in pixels. |
translateY | Number/String | 0 | Y-axis translation in pixels. |
translateZ | Number/String | 0 | Z-axis translation in pixels, used to control the depth effect. |
rotateX | Number/String | 0 | X-axis rotation in degrees. |
rotateY | Number/String | 0 | Y-axis rotation in degrees. |
rotateZ | Number/String | 0 | Z-axis rotation in degrees. |
Usage
MyCardComponent.vue
Component Code
You can copy and paste the following code to create these components: