Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-paper-link

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-paper-link

The default blueprint for ember-cli addons.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

This is an ember-paper addon that extends ember's built in link-to helper and adds paper-button styling and functionality.

The paper-link component makes it easy to have buttons that display an 'active' state based on the current route. Exactly the same as link-to.

There is also a paper-link-item component that creates a list item with the same link-to functionality. Intended for use in nav lists.

Version compatibilityember-paper-link version
Ember 3.11.0+ or ember-paper 1.0.0-beta.27+^1.0.0
Ember < 3.11.0 or ember-paper < 1.0.0-beta.270.0.6

Usage

Example usage:

{{paper-link 'My route' 'my-route'}}
{{#paper-list}}
  {{#paper-link-item 'my-route'}}
    <p>Go to My route</p>
  {{/paper-link-item}}
{{/paper-list}}

Alternative to this addon

paper-button and paper-item both accept an href attribute for link functionality. For internal links the ember-href-to addon is recommended:

{{#paper-button href=(href-to "index")}}
  Home
{{/paper-button}}

ember-href-to has the benefit of being 12x faster than link-to which is used internally by ember-paper-link.

The downside of ember-href-to is that it does not handle displaying an 'active' state based on the current route.

More discussion here

Demo

https://subtletree.github.io/ember-paper-link/

Compatibility

  • Ember.js v3.12 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install ember-paper-link

Don't forget to import your styles in your app.scss after importing ember paper styles:

@import "ember-paper";
@import "ember-paper-link";

API

Has the same api as link-to with the paper-button attributes added.

Make sure to add any link-to parameters before paper-button ones e.g:

{{paper-link 'My route' 'my-route' model raised=true}}

Has the same api as paper-item with the link-to attributes added.

Make sure to add any link-to parameters before paper-item ones e.g:

{{#paper-link-item 'my-route' model class="md-2-line" as |controls|}}
  <img src={{item.img}} alt={{item.name}} class="md-avatar">
  <div class="md-list-item-text">
    <h3>{{item.name}}</h3>
    <p>{{item.email}}</p>
  </div>
{{/paper-link-item}}

Running

  • npm run lint:hbs
  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 04 Jun 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc