Expandable Header Glass
shadcn-glass-ui/expandable-header-glassFreeComponent
Collapsible section header with animated chevron for accordion-style interfaces. * Provides accessible expand/collapse controls with theme-aware styling. * * ## Features
Install it
npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/expandable-header-glass.jsonSource
1/**2 * ExpandableHeaderGlass Component3 *4 * Collapsible section header with animated chevron for accordion-style interfaces.5 * Provides accessible expand/collapse controls with theme-aware styling.6 *7 * ## Features8 * - **Chevron Animation:** Smooth rotation between ChevronUp/ChevronDown icons9 * - **Optional Leading Icon:** Customizable icon with configurable color10 * - **Controlled State:** Requires `expanded` prop for external state management11 * - **Hover Effect:** Subtle background highlight on hover (`bg-white/5`)12 * - **Theme-Aware:** Uses CSS variables for text and icon colors13 * - **ARIA Compliance:** `aria-expanded` attribute for screen readers14 * - **Keyboard Accessible:** Native button element with focus states15 * - **Flexible Layout:** Full-width button with space-between alignment16 * - **Atomic Component:** Extracted from FlagsSectionGlass for reusability17 *18 * ## CSS Variables19 * Uses inline theme CSS variables (no component-specific variables):20 * - `--text-primary` - Header title text color21 * - `--text-muted` - Chevron icon color22 * - `--text-accent` - Leading icon color (default, customizable via `iconColor`)23 *24 * @example Basic usage25 * ```tsx26 * import { ExpandableHeaderGlass } from 'shadcn-glass-ui'27 * import { Flag } from 'lucide-react'28 *29 * function CollapsibleSection() {30 * const [expanded, setExpanded] = useState(false)31 *32 * return (33 * <>34 * <ExpandableHeaderGlass35 * title="Flags"36 * icon={Flag}37 * expanded={expanded}38 * onToggle={() => setExpanded(!expanded)}39 * />40 * {expanded && <div>Section content...</div>}41 * </>42 * )43 * }44 * ```45 *46 * @example Without icon47 * ```tsx48 * <ExpandableHeaderGlass49 * title="Additional Information"50 * expanded={isExpanded}51 * onToggle={handleToggle}52 * />53 * ```54 *55 * @example With custom icon color56 * ```tsx57 * import { AlertTriangle } from 'lucide-react'58 *59 * <ExpandableHeaderGlass60 * title="Warnings"61 * icon={AlertTriangle}62 * iconColor="oklch(65% 0.19 29)" // Orange warning color63 * expanded={warningsExpanded}64 * onToggle={() => setWarningsExpanded(!warningsExpanded)}65 * />66 * ```67 *68 * @example With custom styling69 * ```tsx70 * <ExpandableHeaderGlass71 * title="Advanced Settings"72 * expanded={settingsExpanded}73 * onToggle={toggleSettings}74 * className="bg-white/10 border border-white/20"75 * />76 * ```77 *78 * @accessibility79 * - Uses semantic `<button>` element for proper keyboard support80// … 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 |
