Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/opendatastudio/ember-basic-tabs

Basic tab addon for Ember.
https://github.com/opendatastudio/ember-basic-tabs

ember-addon emberjs tabs

Last synced: 3 days ago
JSON representation

Basic tab addon for Ember.

Awesome Lists containing this project

README

        

# ember-basic-tabs

Unopinionated, no-thrills tabs for Ember.js

## Compatibility

* Ember.js v4.4 or above
* Ember CLI v4.4 or above
* Node.js v14 or above

## Installation

```
ember install @opendatafit/ember-basic-tabs
```

## Usage

### Creating and managing tab state

```javascript
import TabState from `@opendatafit/ember-basic-tabs/utils/tab-state';

tabs = [
{
name: 'model',
title: 'Model',
icon: '',
content: 'some content 1',
},
{
name: 'params',
title: 'Params',
icon: '',
content: 'some content 2',
},
{
name: 'graph',
title: 'Fit graph',
icon: '',
content: 'some content 3',
},
{
name: 'table',
title: 'Fit table',
icon: '',
content: 'some content 4',
},
];

myTabState = null;

constructor() {
super(...arguments);

this.myTabState = new TabState(this.tabs, 0, (name = 'test'));
}

```

### Rendering tab list

```handlebars

{{#each this.myTabState.tabs as |tab index|}}



  • {{tab.title}}


  • {{/each}}

    ```

    ### Rendering panels

    ```handlebars

    {{#each this.myTabState.tabs as |tab index|}}

    {{tab.content}}

    {{/each}}

    ```

    ## Contributing

    See the [Contributing](CONTRIBUTING.md) guide for details.

    ## License

    This project is licensed under the [MIT License](LICENSE.md).