Year Card Glass
shadcn-glass-ui/year-card-glassFreeBlock
@deprecated This prop is no longer used. Sparkline is now only shown in expanded view.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/year-card-glass.jsonSource
1/* eslint-disable react-refresh/only-export-components */2// ========================================3// YEAR CARD GLASS COMPONENT4// Year card with compound API for career timeline5// Issue #15: shadcn/ui compatible compound component6// ========================================78import { forwardRef, type CSSProperties, type ReactNode, useMemo } from 'react';9import { ChevronDown, ChevronUp } from 'lucide-react';10import { cn } from '@/lib/utils';11import { BadgeGlass } from '../../ui/badge-glass';12import { ProgressGlass } from '../../specialized/progress-glass';13import { SparklineGlass } from '../../specialized/sparkline-glass';14import { ButtonGlass } from '../../ui/button-glass';15import { InteractiveCard } from '../../primitives';16import { InsightCardGlass } from '../../atomic/insight-card-glass';17import { YearCardContext, useYearCard, type YearCardContextValue } from './year-card-context';18import type { ProgressGradient } from '@/lib/variants/progress-glass-variants';19import '@/glass-theme.css';2021// ========================================22// TYPES23// ========================================2425export interface YearCardGlassInsight {26 readonly variant?: 'default' | 'tip' | 'highlight' | 'warning' | 'stat' | 'growth' | 'decline';27 readonly emoji?: string;28 readonly text: string;29 readonly detail?: string;30}3132export interface YearCardGlassStat {33 readonly label: string;34 readonly value: string | number;35 readonly icon?: ReactNode;36}3738/** Props for YearCardGlass.Root */39export interface YearCardRootProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {40 /** Whether the card is selected */41 isSelected?: boolean;42 /** Whether the card is expanded */43 isExpanded?: boolean;44 /** Callback when selection is triggered */45 onSelect?: () => void;46 /** Callback when expanded state changes */47 onExpandedChange?: (expanded: boolean) => void;48 children: ReactNode;49}5051/** Props for YearCardGlass.Header */52export interface YearCardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {53 children: ReactNode;54}5556/** Props for YearCardGlass.Year */57export interface YearCardYearProps extends React.HTMLAttributes<HTMLSpanElement> {58 children: ReactNode;59}6061/** Props for YearCardGlass.Badge */62export interface YearCardBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {63 emoji?: string;64 label: string;65}6667/** Props for YearCardGlass.Value */68export interface YearCardValueProps extends React.HTMLAttributes<HTMLSpanElement> {69// … truncated
More from shadcn-glass-ui
All 76 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Ai Card Glassai-card-glass | shadcn-glass-ui | Blocks | Free | no deps | |
| Career Stats Glasscareer-stats-glass | shadcn-glass-ui | Blocks | Free | no deps | |
| Career Stats Header Glasscareer-stats-header-glass | shadcn-glass-ui | Blocks | Free | no deps | |
| Circular Metric Glasscircular-metric-glass | shadcn-glass-ui | Blocks | Free | no deps | |
| Contribution Metrics Glasscontribution-metrics-glass | shadcn-glass-ui | Blocks | Free | no deps | |
| Flags Section Glassflags-section-glass | shadcn-glass-ui | Blocks | Free | no deps | |
| Header Branding Glassheader-branding-glass | shadcn-glass-ui | Blocks | Free | no deps | |
| Header Nav Glassheader-nav-glass | shadcn-glass-ui | Blocks | Free | no deps |
