Separator Glass
shadcn-glass-ui/separator-glassFreeComponent
A glass-themed separator/divider component for visual content separation. * Based on @radix-ui/react-separator with glassmorphism styling. * * Issue #27: Feature request for standalone SeparatorGlass * * @example * ```tsx * // Horizontal separator (default) * <SeparatorGlass /> * * // Vertical separator * <SeparatorGlass orientation="vertical" className="h-4" /> * * // With glow effect * <SeparatorGlass glow /> * * // Decorative (hidden from screen readers) * <SeparatorGlass decorative /> * ```
Install it
npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/separator-glass.jsonSource
1/**2 * SeparatorGlass Component3 *4 * A glass-themed separator/divider component for visual content separation.5 * Based on @radix-ui/react-separator with glassmorphism styling.6 *7 * Issue #27: Feature request for standalone SeparatorGlass8 *9 * @example10 * ```tsx11 * // Horizontal separator (default)12 * <SeparatorGlass />13 *14 * // Vertical separator15 * <SeparatorGlass orientation="vertical" className="h-4" />16 *17 * // With glow effect18 * <SeparatorGlass glow />19 *20 * // Decorative (hidden from screen readers)21 * <SeparatorGlass decorative />22 * ```23 */2425import * as React from 'react';26import * as SeparatorPrimitive from '@radix-ui/react-separator';27import { cn } from '@/lib/utils';28import '@/glass-theme.css';2930// ========================================31// TYPES32// ========================================3334export interface SeparatorGlassProps extends React.ComponentPropsWithoutRef<35 typeof SeparatorPrimitive.Root36> {37 /**38 * The orientation of the separator.39 * @default 'horizontal'40 */41 orientation?: 'horizontal' | 'vertical';4243 /**44 * When true, signifies that it is purely visual and not a semantic separator.45 * @default true46 */47 decorative?: boolean;4849 /**50 * Enable glow effect for the separator.51 * @default false52 */53 glow?: boolean;54}5556// ========================================57// STYLES58// ========================================5960/** Generate inline styles for separator */61function getSeparatorStyles(glow: boolean): React.CSSProperties {62 return {63 background: 'var(--separator-bg)',64 ...(glow && { boxShadow: 'var(--separator-glow)' }),65 };66}6768// ========================================69// COMPONENT70// ========================================7172/**73 * SeparatorGlass - A glass-themed visual separator74 *75 * Renders a horizontal or vertical line to separate content sections.76 * Supports glassmorphism styling with optional glow effect.77 *78 * @example79 * ```tsx80 * <div className="space-y-4">81 * <p>Section 1</p>82 * <SeparatorGlass />83 * <p>Section 2</p>84 * </div>85 * ```86 */87const SeparatorGlass = React.forwardRef<88 React.ComponentRef<typeof SeparatorPrimitive.Root>,89 SeparatorGlassProps90>(({ className, orientation = 'horizontal', decorative = true, glow = false, ...props }, ref) => (91 <SeparatorPrimitive.Root92 ref={ref}93 data-slot="separator-glass"94 decorative={decorative}95 orientation={orientation}96 className={cn(97 // Base styles98 'shrink-0',99100 // Orientation-specific sizing101// … 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 |
