npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ember-named-yields

v1.2.0

Published

Named Yields for Ember Components

Readme

ember-named-yields

A stop-gap for the named yields RFC and based off the experimentation here.

Ember Version Ember Observer Score NPM Build Status

Demo

Install

ember install ember-named-yields

Usage

Setup the named yields in your component template:

{{named-yield 'header'}}

{{yield (hash
  header=(component 'block-for' 'header')
  footer=(component 'block-for' 'footer'
    args=(hash name='footer')
  )
)}}

{{named-yield 'footer'}}

The {{yield}} is the body yield in this example.

Consume

Now to use this component:

{{#custom-card as |yields|}}
  Body content anywhere in the main block

  {{#yields.header}}
    Header content here
  {{/yields.header}}

  {{#yields.footer as |args|}}
    {{capitalize args.name}} content here
  {{/yields.footer}}
{{/custom-card}}

Caveats

This named yield implementation adds extraneous DOM elements to make this work, so keep that in mind when using this addon.

Advanced

Topics beyond the basic usage.

Context

Both named-yield and block-for components take a second positional param which is "optional" since we fallback to a private API, i.e. parentView. If you don't want to use the private API, set the context manually.

{{named-yield 'header' this}}

{{yield (hash
  header=(component 'block-for' 'header' this)
  footer=(component 'block-for' 'footer' this)
)}}

{{named-yield 'footer' this}}

Dynamic Yield Blocks

To allow more control to the end user, e.g. dynamically set the block to yield to.

{{yield (hash
  for=(component 'block-for')
)}}

And can be used like so:

{{#my-card as |yields|}}
  {{#yields.for 'header'}}
    Header
  {{/yields.for}}
{{/my-card}}

Which allows using concat or other helpers to dynamically set the name.

Appending

By default if you call a block-for multiple times, it overwrites the previous content. Sometimes you might want to append to the previous content.

{{#yields.header append=true}}
  A
{{/yields.header}}

{{#yields.header append=true}}
  B
{{/yields.header}}

Now the header will have 'AB' as it's contents.

Contribute

See the CONTRIBUTING.md.