BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-glass-ui/year-card-context

Year Card Context

shadcn-glass-ui/year-card-context
FreeBlock

Hook to access YearCardGlass context

Install it

npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/year-card-context.json

Source

components/glass/composite/year-card-context.tsxraw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/year-card-context.json
1/* eslint-disable react-refresh/only-export-components */
2// ========================================
3// YEAR CARD GLASS CONTEXT
4// Context for compound component state
5// ========================================
6
7import { createContext, useContext } from 'react';
8
9export interface YearCardContextValue {
10 /** Whether the card is selected */
11 isSelected: boolean;
12 /** Whether the card is expanded */
13 isExpanded: boolean;
14 /** Callback when selection is triggered */
15 onSelect?: () => void;
16 /** Callback when expanded state changes */
17 onExpandedChange?: (expanded: boolean) => void;
18}
19
20const YearCardContext = createContext<YearCardContextValue | null>(null);
21
22/**
23 * Hook to access YearCardGlass context
24 * @throws Error if used outside of YearCardGlass.Root
25 */
26export function useYearCard(): YearCardContextValue {
27 const context = useContext(YearCardContext);
28 if (!context) {
29 throw new Error('[YearCardGlass] useYearCard must be used within YearCardGlass.Root');
30 }
31 return context;
32}
33
34/**
35 * Hook to optionally access YearCardGlass context
36 * Returns null if used outside of YearCardGlass.Root
37 */
38export function useYearCardOptional(): YearCardContextValue | null {
39 return useContext(YearCardContext);
40}
41
42export { YearCardContext };

Facts

Registry
shadcn-glass-ui
Type
registry:block
Access
Free
Files written
0
Licence
Apache-2.0
First indexed
2026-08-02
Last confirmed
today

Go to the source

yhooi2.github.io artyhoo/shadcn-glass-ui-library on GitHub Raw registry item This item as JSON

More from shadcn-glass-ui

All 76 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Ai Card Glassai-card-glassshadcn-glass-uiBlocksFreeno deps
Career Stats Glasscareer-stats-glassshadcn-glass-uiBlocksFreeno deps
Career Stats Header Glasscareer-stats-header-glassshadcn-glass-uiBlocksFreeno deps
Circular Metric Glasscircular-metric-glassshadcn-glass-uiBlocksFreeno deps
Contribution Metrics Glasscontribution-metrics-glassshadcn-glass-uiBlocksFreeno deps
Flags Section Glassflags-section-glassshadcn-glass-uiBlocksFreeno deps
Header Branding Glassheader-branding-glassshadcn-glass-uiBlocksFreeno deps
Header Nav Glassheader-nav-glassshadcn-glass-uiBlocksFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex