YOYO Menu
<msc-yoyo-menu />
is a 「Path」 menu like effect. Menu will spray out when user press trigger. Developer could collect some feature triggers or shortcuts through <msc-yoyo-menu />
.
Press the following button and take a look what can <msc-yoyo-menu />
do ?
Basic Usage
<msc-yoyo-menu />
is a web component. All we need to do is put the required script into your HTML document. Then follow <msc-yoyo-menu />
's html structure and everything will be all set.
Required Script
Structure
Put <msc-yoyo-menu />
into HTML document.
JavaScript Instantiation
<msc-yoyo-menu />
could also use JavaScript to create DOM element. Here comes some examples.
Style Customization
<msc-yoyo-menu />
uses CSS custom properties to hook its interface. That means developer could easy change it into the looks you like.
Otherwise delevelopers could also add attribute - data-quadrant
(1 ~ 4) to change menu spray out axis. Default is "1".
Attributes
<msc-yoyo-menu />
supports some attributes to let it become more convenience & useful.
menu
Set menu config. This should be array string. Each unit needs to contain "key" & "title".
Property
Property Name | Type | Description |
---|---|---|
open
|
Boolean | Getter <msc-yoyo-menu /> 's open state. |
menu
|
Array | Setter / Getter <msc-yoyo-menu /> 's menu config. Each unit needs to contain "key" & "title". |
Events
Event Signature | Description |
---|---|
msc-yoyo-memu-click
|
Fired when <msc-yoyo-menu /> clicked. Developers could gather menu information through event.detail . |
msc-yoyo-memu-toggle
|
Fired before <msc-yoyo-menu /> is open or closed. Developers could gather state information through event.detail . |
Mathods
Mathod Signature | Description |
---|---|
click()
|
Simulate <msc-yoyo-menu /> click action. |
toggle(force)
|
Toggle <msc-yoyo-menu /> open or close. (force is optional, developers could set boolean to force open or close) |