Matter Card

A card component built with matter.js

A dynamic card component that uses Matter.js physics engine to create liquid-like interactive effects. The card responds to user interaction with realistic physics-based animations.


Usage

The Matter Card component creates an interactive card with physics-based animations. It's perfect for creating engaging user interfaces with a unique tactile feel.

Component Code

LiquidCard.vue
index.ts

Props

PropTypeDefaultDescription
colorstring#3b82f6Background color of the card
borderRadiusnumber20Border radius of the card in pixels
stiffnessnumber0.1Stiffness of the physics simulation (0.01 to 1)
dampingnumber0.8Damping of the physics simulation (0 to 1)

Features

  • Physics-Based Interactions: Uses Matter.js to create realistic physics simulations for card interactions.
  • Customizable Appearance: Adjust the color and border radius to match your design.
  • Tunable Physics: Control the feel of interactions by adjusting stiffness and damping.
  • Responsive Design: Works well across different screen sizes.
  • Slot-Based Content: Easily add your own content inside the card.

Credits