UI Components Easy
Metric Cards
Dashboard-style metric cards with hover lift, chip badges (positive/negative/neutral), and count-up animation for the main value.
html css javascript
Targets: HTML
Code
Metric Cards
Metric cards for dashboards and landing pages: label, big number with count-up animation, optional suffix, trend chip (positive/negative/neutral), and a subtle hover lift with stronger shadow.
How it works
- Data attributes — Each card uses
data-valueanddata-suffix; script reads them and animates the.valuespan from 0 to the target with an ease-out curve viarequestAnimationFrame. - Chips —
.metric-chipwith classespositive,negative, orneutralfor color and semantics. - Hover — CSS
transform: translateY(-10px) scale(1.01)and a largerbox-shadowon hover.
When to use it
- SaaS dashboards and analytics blocks
- Landing pages highlighting KPIs or stats
- Any grid of key numbers that should feel interactive and readable