Socket
Book a DemoInstallSign in
Socket

react-glass-ui

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-glass-ui

A customizable React component library for creating elegant glassmorphism interfaces. It provides flexible, interactive UI elements, such as cards, buttons, and inputs, with effects including blur, saturation, distortion, light glow, and hover.

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
348
25.18%
Maintainers
1
Weekly downloads
 
Created
Source

React Glass UI

A customizable React component library for creating elegant glassmorphism interfaces. It provides flexible, interactive UI elements, such as cards, buttons, and inputs, with effects including blur, saturation, distortion, light glow, and hover.

Live Demo / Playground

View Live Demo

Demo Screenshot

Try out the components in an interactive playground.

Browser Support

This library offers limited support across all modern browsers, but is optimized for Chrome for the best visual quality and performance.

Features

  • GlassCard with distortion, glow, and hover flexibility
  • GlassButton with customizable light and motion effects
  • GlassInput with built-in label and glass styling
  • TypeScript support
  • Easily integrates into any layout or theme

Installation

npm install react-glass-ui

Usage

<GlassCard />

import { GlassCard } from "react-glass-ui";

<GlassCard>Hello World</GlassCard>

<GlassButton />

import { GlassButton } from "react-glass-ui";

<GlassButton>Click Me</GlassButton>

<GlassInput />

import { GlassInput } from "react-glass-ui";

<GlassInput label="Email:" placeholder="you@example.com" />

Shared Props (CommonGlassProps)

All glass components accept these props:

PropTypeDescription
idstringUnique identifier (useful for accessibility or testing).
keyanyReact key (usually used in lists).
namestringInput or component name (used in forms).
widthnumberComponent width in pixels.
heightnumberComponent height in pixels.
classNamestringExtra CSS classes for the root element.
contentClassNamestringExtra CSS classes for the inner content container.
contentCenterbooleanCenter content horizontally.
itemsCenterbooleanCenter content vertically.
blurnumberBackground blur radius (e.g., 4blur(4px)).
distortionnumberDistortion intensity (0–100, requires SVG filter).
chromaticAberrationnumberColor fringing intensity (requires SVG filter).
brightnessnumberBrightness multiplier (e.g., 100 = normal, 80 = dim).
saturationnumberContent saturation level (e.g., 100 = normal, 120 = vivid).
borderRadiusnumberCorner radius in pixels.
borderSizenumberBorder thickness in pixels.
borderColorstringBorder color.
borderOpacitynumberBorder opacity (0 to 1).
backgroundColorstringBackground color overlay.
backgroundOpacitynumberOpacity of the background (0 to 1).
colorstringText color for children.
innerLightBlurnumberInner glow blur radius.
innerLightSpreadnumberInner glow spread distance (in px).
innerLightColorstringInner glow color.
innerLightOpacitynumberInner glow opacity (0 to 1).
outerLightBlurnumberOuter glow blur radius.
outerLightSpreadnumberOuter glow spread distance (in px).
outerLightColorstringOuter glow color.
outerLightOpacitynumberOuter glow opacity (0 to 1).
flexibilitynumberEnables responsiveness to hover, motion, and distortion.
onHoverScalenumberScale multiplier on hover (requires flexibility > 0).
paddingstringPadding (CSS shorthand, e.g. "12px 16px").
zIndexnumberComponent stacking order.
avoidSvgCreationbooleanSkip SVG filter rendering (use only if you're handling filters manually).
onClick() => voidClick handler.

Component-Specific Props

<GlassCard />

PropTypeDescription
childrenReact.ReactNodeContent to render inside the card.

Inherits all CommonGlassProps

<GlassButton />

PropTypeDescription
childrenReact.ReactNodeButton content (text, icon, etc.).

Inherits all CommonGlassProps

<GlassInput />

PropTypeDescription
typestringInput type (text, file, range, etc.).
valueanyCurrent input value.
placeholderstringPlaceholder text.
labelstringOptional label displayed above the input.
labelColorstringLabel text color.
maxLengthnumberMax character length (text input only).
minLengthnumberMin character length.
minnumberMinimum value (for range/number types).
maxnumberMaximum value (for range/number types).
stepnumberStep size (for range/number inputs).
multiplebooleanAllows multiple file selection (file input).
requiredbooleanMarks the input as required.
autofocusbooleanAutofocus on mount.
onChange(e: React.ChangeEvent<HTMLInputElement>)Input change handler.

Inherits all CommonGlassProps

Development

npm install
npm run build

License (MIT)

Copyright (c) 2025 Yash Kamnani

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

react

FAQs

Package last updated on 17 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts