Blaze UI is a modern, lightweight UI library that combines the simplicity of React with the performance of Svelte and the reactivity of SolidJS. Built with TypeScript and designed for modern web applications.
npm install blaze-ui
import { state, effect, Button, Input } from 'blaze-ui';
// Create reactive state
const [count, setCount] = state(0);
// Create effect to update DOM
effect(() => {
document.getElementById('counter').textContent = `Count: ${count()}`;
});
// Create components
const button = Button({
children: 'Increment',
onClick: () => setCount(count() + 1)
});
const input = Input({
placeholder: 'Enter text...',
onChange: (value) => console.log('Input:', value)
});
import { state } from 'blaze-ui';
// Create reactive state
const [count, setCount] = state(0);
// Read state
console.log(count()); // 0
// Update state
setCount(5);
console.log(count()); // 5
// Update with function
setCount(prev => prev + 1);
console.log(count()); // 6
import { state, effect } from 'blaze-ui';
const [name, setName] = state('John');
// Create effect that runs when dependencies change
effect(() => {
document.title = `Hello, ${name()}!`;
});
// Effect will automatically run when name changes
setName('Jane'); // Title updates to "Hello, Jane!"
import { Button, Input, Card, Alert } from 'blaze-ui';
// Button component
const button = Button({
children: 'Click me',
variant: 'primary',
onClick: () => alert('Clicked!')
});
// Input component
const input = Input({
placeholder: 'Enter text...',
onChange: (value) => console.log(value)
});
// Card component
const card = Card({
title: 'My Card',
children: 'Card content here'
});
// Alert component
const alert = Alert({
type: 'success',
message: 'Operation completed!',
dismissible: true
});
import { createStore, useStore } from 'blaze-ui';
// Create global store
const userStore = createStore({
name: 'John Doe',
age: 30,
preferences: { theme: 'light' }
});
// Use store in components
const [getUser, setUser] = useStore(userStore);
// Update store
setUser(prev => ({
...prev,
age: 31
}));
import { createForm, validationRules } from 'blaze-ui';
const form = createForm({
initialValues: {
email: '',
password: ''
},
validation: {
email: validationRules.required,
password: [validationRules.required, validationRules.minLength(8)]
},
onSubmit: (values) => {
console.log('Form submitted:', values);
}
});
import { animations } from 'blaze-ui';
// Fade in animation
const element = document.getElementById('my-element');
const cancelAnimation = animations.fadeIn(element, 300);
// Cancel animation
cancelAnimation();
npm run dev
The development server will start at http://localhost:3000/
npm run dev
- Start development servernpm run build
- Build for productionnpm run test
- Run testsnpm run lint
- Run ESLintblaze-ui/
โโโ src/
โ โโโ core/ # Core reactive system
โ โโโ components/ # UI components
โ โโโ forms/ # Form system
โ โโโ animation/ # Animation system
โ โโโ router/ # Routing
โ โโโ store/ # State management
โ โโโ devtools/ # Developer tools
โ โโโ utils/ # Utilities
โโโ demo/ # Demo applications
โโโ tests/ # Test files
โโโ examples/ # Example applications
We welcome contributions! Please see our Contributing Guide for details.
npm install
npm run dev
npm run test
Blaze UI is licensed under the MIT License. See LICENSE for details.
Made with โค๏ธ by the Blaze UI team