0.0.21 • Published 7 years ago

ember-flex-menu v0.0.21

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

npm version Build Status

ember-flex-menu

ember-flex-menu is a flexible menu component that has built-in support for keyboard navigation, multiple column layouts, and buttons that can toggle into inputs.

Installation

ember install ember-flex-menu

Usage

export default Ember.Controller.extend({
  choices: ['foo', 'bar', 'baz'],

  actions: {
    myAction(choice) {
      console.log(choice);
    }
  }
});
{{ember-flex-menu choices=choices onChoose=(action "myAction")}}
// styles/app.scss
@import "ember-flex-menu/ember-flex-menu";

This results in a single column menu with buttons 'foo', 'bar', and 'baz'. If 'bar' is clicked, then 'myAction' will receive:

myAction(choice) {
  console.log(choice); // { text: 'bar', value: 'bar' }
}

inputable

export default Ember.Controller.extend({
  choices: ['foo', { text: 'bar', inputable: true }, 'baz'],

  actions: {
    myAction(choice) {
      console.log(choice); // { text: 'bar', value: 'the value that was input' }
    }
  }
});

columns

To display multiple columns:

{{ember-flex-menu choices=choices columns=5}}

Key Bindings

By default:

export default Ember.Component.extend({
  customMoveDown: ['KeyS']
})
{{ember-flex-menu moveDownKeys=customMoveDown}}

Consult the ember-keyboard docs for more info on key names.

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago