Ziya/ui/widgets/trading-stats/ui/stats-card.slint
2025-06-27 07:27:24 +07:00

55 lines
No EOL
1.5 KiB
Text

import { VerticalBox } from "std-widgets.slint";
// Professional stats card component with direct styling
export component StatsCard {
in property <string> title: "Stat Title";
in property <string> value: "$0.00";
in property <string> change: "0%";
in property <bool> positive: true;
in property <color> accent-color: #570df8;
min-width: 200px;
height: 120px;
Rectangle {
background: #ffffff;
border-radius: 12px;
border-width: 1px;
border-color: #e5e6e6;
drop-shadow-blur: 8px;
drop-shadow-color: #00000008;
VerticalBox {
padding: 20px;
spacing: 8px;
alignment: start;
// Title
Text {
text: title;
color: #64748b;
font-size: 14px;
font-weight: 500;
horizontal-alignment: left;
}
// Main value
Text {
text: value;
color: accent-color;
font-size: 32px;
font-weight: 700;
horizontal-alignment: left;
}
// Change indicator
Text {
text: change;
color: positive ? #36d399 : #f87272;
font-size: 13px;
font-weight: 500;
horizontal-alignment: left;
}
}
}
}