Profile Header Glass
shadcn-glass-ui/profile-header-glassFreeBlock
Layout mode for the profile header
Install it
npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/profile-header-glass.jsonSource
1// ========================================2// PROFILE HEADER GLASS COMPONENT3// Compound Component API + Legacy API4// ========================================56import { createContext, forwardRef, useContext } from 'react';7import { cn } from '@/lib/utils';8import {9 ProfileHeaderExtendedGlass,10 type ExtendedProfileUser,11} from './profile-header-extended-glass';12import { AICardGlass, type AICardGlassProps } from '../composite/ai-card-glass';13import type { LanguageData } from '../specialized/language-bar-glass';14import '@/glass-theme.css';1516// ========================================17// CONTEXT18// ========================================1920interface ProfileHeaderContextValue {21 layout: 'horizontal' | 'stacked';22}2324const ProfileHeaderContext = createContext<ProfileHeaderContextValue | null>(null);2526function useProfileHeaderContext() {27 const context = useContext(ProfileHeaderContext);28 if (!context) {29 throw new Error(30 'ProfileHeader compound components must be used within ProfileHeaderGlass.Root'31 );32 }33 return context;34}3536// ========================================37// COMPOUND COMPONENTS38// ========================================3940export interface ProfileHeaderRootProps extends React.HTMLAttributes<HTMLDivElement> {41 /**42 * Layout mode for the profile header43 * - 'horizontal': 50/50 split on desktop (default)44 * - 'stacked': Vertical stack on all breakpoints45 * @default 'horizontal'46 */47 readonly layout?: 'horizontal' | 'stacked';48}4950/**51 * ProfileHeaderGlass.Root - Container for compound component API52 *53 * @example54 * ```tsx55 * <ProfileHeaderGlass.Root layout="horizontal">56 * <ProfileHeaderGlass.Profile user={user} />57 * <ProfileHeaderGlass.AI onGenerate={handleGenerate} />58 * </ProfileHeaderGlass.Root>59 * ```60 */61const ProfileHeaderRoot = forwardRef<HTMLDivElement, ProfileHeaderRootProps>(62 ({ layout = 'horizontal', className, children, ...props }, ref) => {63 const isHorizontal = layout === 'horizontal';6465 return (66 <ProfileHeaderContext.Provider value={{ layout }}>67 <div68 ref={ref}69 className={cn(70 'flex gap-3',71 isHorizontal ? 'flex-col lg:flex-row lg:gap-0' : 'flex-col',72 className73 )}74 {...props}75 >76 {children}77 </div>78 </ProfileHeaderContext.Provider>79 );80 }81);8283ProfileHeaderRoot.displayName = 'ProfileHeaderGlass.Root';8485export interface ProfileHeaderProfileProps extends Omit<86// … 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 |
