A modern TypeScript library for creating beautiful glowing border effects around HTML elements.
npm add glowing
yarn add glowing
pnpm add glowing
import { Glowing } from 'glowing'
// Create a glowing effect around an element
const element = document.querySelector('.my-element')
const glow = new Glowing(element, options)
// Control methods
glow.show() // Show the glow effect
glow.hide() // Hide the glow effect
glow.toggle() // Toggle visibility
glow.remove() // Remove the glow effect completely
// Set options
glow.setOptions({
// Animation duration in ms
rotationDuration: 2000,
// Glow width in pixels
width: 4,
// Blend mode for the glow effect
blendMode: 'color-dodge',
// Custom gradient colors
colors: ['cyan', 'purple', 'tomato'],
// Additional gradient colors
colors2: ['white', 'transparent', 'transparent', 'white', 'transparent', 'transparent', 'white'],
// Blur intensity of the glow
glowingBlurRatio: 1.5,
// Optional timeout to auto-hide the glow (in ms)
timeout: 3000,
// Optional border radius override
borderRadius: 8,
})
npm run dev
- Start development server with hot reloadnpm run build
- Build the package for productionnpm test
- Run testsnpm run format
- Format all files using Prettiernpm run format:check
- Check if files are properly formatted
This package includes TypeScript type definitions. No additional @types packages are needed.
The package is built for modern browsers and includes:
- ES Modules build
- CommonJS build
- TypeScript declarations
- Source maps
MIT