A customizable React component library for building liquid-glass interfaces with dynamic, realistic fluid distortion. Powered by advanced SVG filters, the library simulates true refraction, blur, and chromatic distortion to create authentic glass-like sur
npm install react-glass-uibash
npm install react-glass-ui
`
Usage
$3
`tsx
import { GlassCard } from "react-glass-ui";
Hello World
`
$3
`tsx
import { GlassButton } from "react-glass-ui";
Click Me
`
$3
`tsx
import { GlassInput } from "react-glass-ui";
`
Shared Props (
CommonGlassProps)
All glass components accept these props:
| Prop | Type | Description |
| --------------------- | ------------ | ------------------------------------------------------------------------- |
| id | string | Unique identifier (useful for accessibility or testing). |
| key | any | React key (usually used in lists). |
| name | string | Input or component name (used in forms). |
| width | number | Component width in pixels. |
| height | number | Component height in pixels. |
| className | string | Extra CSS classes for the root element. |
| contentClassName | string | Extra CSS classes for the inner content container. |
| contentCenter | boolean | Center content horizontally. |
| itemsCenter | boolean | Center content vertically. |
| blur | number | Background blur radius (e.g., 4 → blur(4px)). |
| distortion | number | Distortion intensity (0–100, requires SVG filter). |
| chromaticAberration | number | Color fringing intensity (requires SVG filter). |
| brightness | number | Brightness multiplier (e.g., 100 = normal, 80 = dim). |
| saturation | number | Content saturation level (e.g., 100 = normal, 120 = vivid). |
| borderRadius | number | Corner radius in pixels. |
| borderSize | number | Border thickness in pixels. |
| borderColor | string | Border color. |
| borderOpacity | number | Border opacity (0 to 1). |
| backgroundColor | string | Background color overlay. |
| backgroundOpacity | number | Opacity of the background (0 to 1). |
| color | string | Text color for children. |
| innerLightBlur | number | Inner glow blur radius. |
| innerLightSpread | number | Inner glow spread distance (in px). |
| innerLightColor | string | Inner glow color. |
| innerLightOpacity | number | Inner glow opacity (0 to 1). |
| outerLightBlur | number | Outer glow blur radius. |
| outerLightSpread | number | Outer glow spread distance (in px). |
| outerLightColor | string | Outer glow color. |
| outerLightOpacity | number | Outer glow opacity (0 to 1). |
| flexibility | number | Enables responsiveness to hover, motion, and distortion. |
| onHoverScale | number | Scale multiplier on hover (requires flexibility > 0). |
| padding | string | Padding (CSS shorthand, e.g. "12px 16px"). |
| zIndex | number | Component stacking order. |
| avoidSvgCreation | boolean | Skip SVG filter rendering (use only if you're handling filters manually). |
| onClick | () => void | Click handler. |
---
Component-Specific Props
$3
| Prop | Type | Description |
| ---------- | ----------------- | ---------------------------------- |
| children | React.ReactNode | Content to render inside the card. |
> Inherits all CommonGlassProps
---
$3
| Prop | Type | Description |
| ---------- | ----------------- | ---------------------------------- |
| children | React.ReactNode | Button content (text, icon, etc.). |
> Inherits all CommonGlassProps
---
$3
| Prop | Type | Description |
| ----------------------- | ------------------------------------------- | ----------------------------------------------------------------- |
| type | string | Input type (text, file, range, etc.). |
| value | any | Current input value. |
| placeholder | string | Placeholder text. |
| label | string | Optional label displayed above the input. |
| labelColor | string | Label text color. |
| maxLength | number | Max character length (text input only). |
| minLength | number | Min character length. |
| min | number | Minimum value (for range/number types). |
| max | number | Maximum value (for range/number types). |
| step | number | Step size (for range/number inputs). |
| multiple | boolean | Allows multiple file selection (file input). |
| required | boolean | Marks the input as required. |
| autofocus | boolean | Autofocus on mount. |
| inputRangeBlur | number | Blur intensity applied only to the slider track/thumb. |
| inputRangeDistortion | number | Distortion strength applied to the liquid-glass range animation. |
| onChange | (e: React.ChangeEvent | Input change handler. |
> Inherits all CommonGlassProps
Development
`bash
npm install
npm run build
``