Reference to the button.
Wether button should be disabled.
Name of the Material icon printed inside button.
Image shown on hover.
Menu item list.
Caption inside button.
Button
by default.
Executed when user clicks a menu item.
Tooltip shown on hover.
Material style of the button.
basic
by default.
<drayman-menu />
Menu powered by Angular Material library.
Example of usage
import axios from 'axios'; export const component: DraymanComponent = async ({ forceUpdate }) => { let selectedImg; let selectedBreed; const dogBreeds = (await axios.get(`https://dog.ceo/api/breeds/list/all`)).data.message; return () => { return ( <div> <drayman-menu label={`${selectedBreed || 'Dog'}`} items={ Object .keys(dogBreeds) .map(x => ({ label: x, breed: x, items: dogBreeds[x].map(xx => ({ label: xx, breed: `${x}/${xx}` })), })) } onItemClick={async ({ item }) => { selectedImg = (await axios.get(`https://dog.ceo/api/breed/${item.breed}/images/random`)).data.message; selectedBreed = item.breed; await forceUpdate(); }} /> {selectedImg && <img src={selectedImg} style={{ width: '350px', height: 'auto' }} />} </div> ); } }