Repository navigation
v1.1.0 - Toggle Mode π
π New Features
π Toggle Mode - Transform buttons into interactive toggle switches with persistent pressed states
toggleprop to enable toggle/switch functionalitydefaultActiveprop for uncontrolled toggle stateonChangecallback for toggle state changesactiveprop for controlled mode support- Works seamlessly with all button variants and themes
- Smooth animations without initial render flash
π Bug Fixes
- π¨ Fixed SVG icon color inheritance - Icons now properly inherit text color using
currentColor - β‘ Fixed initial render flash for buttons with
defaultActive={true} - ποΈ Fixed icon fill color issues across different button types
π Documentation
- Added comprehensive toggle mode examples in README
- Added toggle showcase page in demo app
- Updated API reference with toggle props
- Added controlled and uncontrolled usage examples
π Links
- π¦ npm package
- π» Live Demo
- π Toggle Examples
π¦ Installation
npm install react-3d-button@1.1.0β Quick Example
import { Button3D } from 'react-3d-button';
import 'react-3d-button/dist/styles.css';
const [notifications, setNotifications] = useState(true);
<Button3D
type="success"
toggle
active={notifications}
onChange={setNotifications}
>
{notifications ? 'β ON' : 'OFF'}
</Button3D>π― Toggle Mode Use Cases
- Settings Panels - Dark mode, notifications, wifi toggles
- Feature Flags - Enable/disable application features
- Form Inputs - Binary choices with visual feedback
- Status Indicators - Show on/off states
- Interactive UI - Any switch/toggle interaction
π Breaking Changes
None - This is a backward compatible feature addition.
π Credits
Thank you to all users who requested toggle functionality!