Tabs Glass
shadcn-glass-ui/tabs-glassFreeComponent
TabsGlass Component (Radix UI based)
Install it
npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/tabs-glass.jsonSource
1/* eslint-disable react-refresh/only-export-components */2/**3 * TabsGlass Component (Radix UI based)4 *5 * Glass-themed tab navigation built on Radix UI primitives with:6 * - 100% shadcn/ui type compatibility7 * - Theme-aware styling (glass/light/aurora)8 * - Active tab indicator9 * - Full keyboard navigation (Arrow keys, Home, End)10 * - Support for orientation, dir, activationMode11 *12 * @since v2.2.6 - Migrated to Radix UI primitives for full type compatibility13 */1415import * as React from 'react';16import * as TabsPrimitive from '@radix-ui/react-tabs';17import { cn } from '@/lib/utils';18import '@/glass-theme.css';1920// ========================================21// TYPES22// ========================================2324/**25 * Legacy TabItem interface for backwards compatibility26 */27export interface TabItem {28 readonly id: string;29 readonly label: string;30}3132/**33 * Props for TabsGlass Root component34 *35 * Extends Radix UI Tabs.Root props for 100% shadcn/ui compatibility.36 * All Radix props are supported including: value, defaultValue, onValueChange,37 * orientation, dir, activationMode.38 *39 * **Type Compatibility (v2.3.1+):**40 * - Extends `React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>`41 * - No more `as unknown as` type assertions needed42 * - Full IntelliSense for all Radix props43 *44 * **New props from Radix:**45 * - `orientation`: 'horizontal' | 'vertical' - Tab layout direction46 * - `dir`: 'ltr' | 'rtl' - Text direction for RTL support47 * - `activationMode`: 'automatic' | 'manual' - Tab activation behavior48 *49 * @accessibility50 * - **Keyboard Navigation:** Arrow keys navigate between tabs (respects orientation)51 * - **Focus Management:** Visible focus ring using CSS variables52 * - **Screen Readers:** Radix UI handles all ARIA attributes automatically53 * - **RTL Support:** Full RTL support via `dir` prop54 *55 * @example56 * ```tsx57 * // Basic usage58 * <Tabs defaultValue="tab1">59 * <TabsList>60 * <TabsTrigger value="tab1">Tab 1</TabsTrigger>61 * <TabsTrigger value="tab2">Tab 2</TabsTrigger>62 * </TabsList>63 * <TabsContent value="tab1">Content 1</TabsContent>64 * <TabsContent value="tab2">Content 2</TabsContent>65 * </Tabs>66 *67 * // Vertical tabs68 * <Tabs defaultValue="tab1" orientation="vertical">69 * <TabsList>70 * <TabsTrigger value="tab1">Tab 1</TabsTrigger>71 * <TabsTrigger value="tab2">Tab 2</TabsTrigger>72 * </TabsList>73 * <TabsContent value="tab1">Content 1</TabsContent>74 * </Tabs>75 *76// … 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 |
