![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ember-burger-menu
Advanced tools
An off-canvas sidebar component with a collection of animations and styles using CSS transitions
An off-canvas sidebar component with a collection of animations and styles using CSS transitions
ember install ember-burger-menu
If it is a bug please open an issue on GitHub.
This addon utilizes contextual components to be able to correctly control and animate necessary elements.
{{#burger-menu as |burger|}}
{{#burger.menu itemTagName="li" as |menu|}}
<a {{action burger.state.actions.toggle}} class="close fa fa-times"></a>
<ul>
{{#menu.item}}
{{link-to 'Features' 'features'}}
{{/menu.item}}
{{#menu.item}}
{{link-to 'About' 'about'}}
{{/menu.item}}
{{#menu.item}}
{{link-to 'Contact Us' 'contact'}}
{{/menu.item}}
</ul>
{{/burger.menu}}
{{#burger.outlet}}
<a class="fa fa-bars" {{action burger.state.actions.toggle}}></a>
{{outlet}}
{{/burger.outlet}}
{{/burger-menu}}
{{burger-menu}}
open
The current open state of the menu.
Default: false
animation
The menu animation. See Animations for the list of available animations.
Default: slide
itemAnimation
The menu item animation. See Item Animations for the list of available item animations.
Default: null
position
The menu's open position. Can either be left or right
Default: left
width
The menu's width (in px).
Default: 300
customAnimation
Override of the menu's styles with your own implementation. See Custom Animations for more details.
translucentOverlay
Whether the outlet has a translucent overlay over it once the menu is opened.
Default: true
dismissOnClick
Whether the menu can be dismissed when clicking outside of it.
Default: true
dismissOnEsc
Whether the menu can be closed when pressing the ESC key.
Default: true
minSwipeDistance
The minimum distance (in px) the user must swipe to register as valid.
Default: 150
maxSwipeTime
The maximum amount of time (in ms) it must take the user to swipe to be registered as valid .
Default: 300
{{burger.outlet}}
This component is where all your content should be placed.
{{burger.menu}}
Everything rendered here will be inside the menu.
itemTagName
The default tagName that will be used by the {{menu.item}}
component.
Default: div
onOpen
Triggered when the menu is opening
onClose
Triggered when the menu is closing
{{menu.item}}
This component is only needed when using an item animation.
The {{burger-menu}}
component exposed multiple contextual components, but it also exposes a state object which allows you to control the state of the menu.
{{#burger-menu as |burger|}}
{{#burger.outlet}}
<a {{action burger.state.actions.toggle}} class="close fa fa-times"></a>
{{/burger.outlet}}
{{/burger-menu}}
If you need a more programmatic solution, you can grab the menu state via a simple import.
import burgerMenu from 'ember-burger-menu';
You can use the menu state object to modify pretty much any property.
open
width
position
animation
itemAnimation
customAnimation
burgerMenu.set('width', 500);
burgerMenu.toggleProperty('open');
The state object also exposes some actions.
open
<button {{action burger.state.actions.open}}>Open</button>
close
<button {{action burger.state.actions.close}}>Close</button>
toggle
<button {{action burger.state.actions.toggle}}>Toggle</button>
If you're not impressed with the in-house animations and want to create your own, all you have to do is pass the following class to the customAnimation
property in the {{burger-menu}}
component. If you think your animation would be a good addition to the existing collection, feel free to open a PR with it!
import Animation from 'ember-burger-menu/animations/base';
export default Animation.extend({
// CSS class names to be able to target our menu
animation: 'my-custom-animation',
itemAnimation: 'my-custom-item-animation',
container(open, width, right) {
return {};
},
outlet(open, width, right) {
return {
transform: open ? right ? `translate3d(-${width}px, 0, 0)` : `translate3d(${width}px, 0, 0)` : ''
};
},
menu(open, width, right) {
return {};
},
menuItem(open, width, right, index) {
return {
transform: open ? '' : `translate3d(0, ${(index + 1) * 500}px, 0)`
};
}
});
Note: You don't need to worry about prefixing your CSS attributes as it will be done for you.
If you need to add some base CSS to your animation, you can target the menu as such:
.ember-burger-menu.bm--my-custom-animation {
.bm-menu {}
.bm-outlet {}
&.is-open {
.bm-menu {}
.bm-outlet {}
}
}
And the menu items as such:
.ember-burger-menu {
.bm-menu.bm-item--my-custom-item-animation {
.bm-menu-item {}
}
&.is-open {
.bm-menu.bm-item--my-custom-item-animation {
.bm-menu-item {}
}
}
}
To use our new custom animation, all we have to do is pass the class to
the customAnimation
option in the {{burger-menu}}
component.
import MyCustomAnimation from 'path/to/my-custom-animation';
export default Ember.Component.extend({
MyCustomAnimation
});
{{#burger-menu customAnimation=MyCustomAnimation}}
...
{{/burger-menu}}
v0.2.1
FAQs
An off-canvas sidebar component with a collection of animations and styles using CSS transitions
The npm package ember-burger-menu receives a total of 0 weekly downloads. As such, ember-burger-menu popularity was classified as not popular.
We found that ember-burger-menu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.