@violetui/toggle_button
v0.1.1-beta.0
Published
> TODO: description
Downloads
3
Readme
@violetui/toggle_button
Usage
first import the ToggleButton component:
const ToggleButton = require('@violetui/toggle_button');
// or
import ToggleButton From '@violetui/toggle_button'
use it:
const Component = () => {
const [items,setItems] = useState([
{text:'Button',icon:<Icon/>,selected:true,disable:false},
{text:'Button2',icon:<Icon2/>,selected:false,disable:false},
])
const handleChange =(newItems)=>{
setItems(newItems)
}
return (<ToggleButton items={items} onChange={handleChange} />;)
};
Props
multiple(optional): boolean
corner(optional): "circle" | "rounded" | "square"
color(optional): "primary" | "secondary" | "tertiary" | "error" | "warning" | "success"
items: arrayOfItems --> {text?:string, icon?:string, selected:boolean, disable?:boolean}