Stat Item Glass
shadcn-glass-ui/stat-item-glassFreeComponent
Compact statistic display component with icon, value, and label for profile cards and dashboards. * Designed for inline metrics with automatic value formatting and flexible layouts. * * ## Features
Install it
npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/stat-item-glass.jsonSource
1/**2 * StatItemGlass Component3 *4 * Compact statistic display component with icon, value, and label for profile cards and dashboards.5 * Designed for inline metrics with automatic value formatting and flexible layouts.6 *7 * ## Features8 * - **Icon + Value + Label:** Clean three-part layout with Lucide icon support9 * - **3 Size Variants:** sm (12px), md (14px), lg (16px) text sizes10 * - **2 Layout Modes:** horizontal (default) and vertical layouts11 * - **Value Formatting:** Automatic number abbreviation (1.2k, 2.5M) in abbreviated mode12 * - **Flexible Values:** Supports both numbers and pre-formatted strings13 * - **Theme-Aware Colors:** Uses CSS variables for icon accent and text14 * - **Customizable Icon Size:** Configurable icon dimensions via `iconSize` prop15 * - **Compact Design:** Minimal spacing optimized for inline use16 * - **Atomic Component:** Extracted from ProfileHeaderGlass for reusability17 *18 * ## CSS Variables19 * Uses inline theme CSS variables (no component-specific variables):20 * - `--text-secondary` - Stat value and label text color21 * - `--text-accent` - Icon color22 *23 * @example Basic usage24 * ```tsx25 * import { StatItemGlass } from 'shadcn-glass-ui'26 * import { Star } from 'lucide-react'27 *28 * function UserProfile() {29 * return (30 * <StatItemGlass31 * icon={Star}32 * value={1234}33 * label="stars"34 * />35 * )36 * }37 * ```38 *39 * @example With abbreviated values40 * ```tsx41 * import { GitCommit } from 'lucide-react'42 *43 * <StatItemGlass44 * icon={GitCommit}45 * value={15678}46 * label="commits"47 * abbreviated={true}48 * />49 * // Renders: "15.7k commits"50 * ```51 *52 * @example Vertical layout with large size53 * ```tsx54 * import { Users } from 'lucide-react'55 *56 * <StatItemGlass57 * icon={Users}58 * value={250}59 * label="followers"60 * size="lg"61 * layout="vertical"62 * iconSize={20}63 * />64 * ```65 *66 * @example With pre-formatted string value67 * ```tsx68 * import { Calendar } from 'lucide-react'69 *70 * <StatItemGlass71 * icon={Calendar}72 * value="2 years"73 * label="active"74 * size="sm"75 * />76 * ```77 *78 * @accessibility79 * - Uses semantic `<span>` element for inline display80 * - Icon has proper color contrast via `--text-accent`81 * - Font weight (`font-medium`) improves readability82 * - Supports custom `aria-label` via spread props83 * - No interactive elements, purely informational84 * - WCAG 2.1 AA compliant color contrast85 *86 * @since v1.0.087 */8889// ========================================90// … truncated
More from shadcn-glass-ui
All 76 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alert Glassalert-glass | shadcn-glass-ui | Components | Free | no deps | |
| Animated Background Glassanimated-background-glass | shadcn-glass-ui | Components | Free | no deps | |
| Avatar Glassavatar-glass | shadcn-glass-ui | Components | Free | no deps | |
| Badge Glassbadge-glass | shadcn-glass-ui | Components | Free | no deps | |
| Base Progress Glassbase-progress-glass | shadcn-glass-ui | Components | Free | no deps | |
| Button Glassbutton-glass | shadcn-glass-ui | Components | Free | no deps | |
| Card Glasscard-glass | shadcn-glass-ui | Components | Free | no deps | |
| Checkbox Glasscheckbox-glass | shadcn-glass-ui | Components | Free | no deps |
