Some love for Blaze: Teleport

I never found a package to teleport stuff (render templates at arbitrary locations inside the DOM) with Blaze, so I built my own. This was over a year ago. My plan was to publish it, but then life intervened.

Late last night I was trying to avoid bedtime, so here you go! Seems I was procrastinating heavily, since I even made a logo for it :sweat_smile:

https://atmospherejs.com/arggh/teleport

It’s about 20 lines of code and so far has been working great for me.

Quick how-to

  1. Add to project
$ meteor add arggh:teleport
  1. Use the Teleport block helper anywhere.
<template name="my-tmpl">
   <div class="foo">
     {{#Teleport ''}}
        <p>Hello world</p>
     {{/Teleport}}
   </div>
</template>

…will result in this:

<body>
  <div class="foo"></div>
  <p>Hello world</p>
</body>

The default destination is document.body, but a destination prop can be provided and it should be an Element node or a CSS selector.

<template name="my-tmpl2">
   <div class="foo">
     {{#Teleport destination='.bar'}}
        <p>Hello world</p>
     {{/Teleport}}
   </div>
</template>

Let me know if you have any problems with it :wink:

9 Likes

Great to see that people still have interest in Blaze!

1 Like

I hope I find time to polish and share more of our Blaze components, but actually I’m really busy building awesome stuff with Meteor&Blaze!:slight_smile:

We have internal Blaze components and packages like

  • AutoFit - fit any text inside it’s parent perfectly
  • InfinityScroll - virtual scrollable
  • ComponentBrowser - “Storybook” for Blaze

…and about 150 other generalized (but also internal) Blaze components for various purposes, like modals, popovers, color pickers etc…

1 Like

Wow! Seriously interested in this work. I’m still using Blaze very happily in a couple of big projects.

I know what you mean, I am also really busy and have a lot of Blaze components, especially for Autoform, that need to be polished.

Anyone interested in a “Blaze Poweruser” group or something? Like a github org that solely keeps Blaze related projects and packages, like a first entry point for the latest maintained packages for Blaze?

1 Like

A brilliant idea. “Awesome Blaze”, sort of. There’s still a lot of Blaze users and from what I hear, many are planning to stick with it for foreseeable future. Then again, Atmosphere is full of packages for Blaze, but they are hard to find & filter.

I like this.

Now my flow goes like this:

  1. I have a need for a functionality
  2. Try to browse & search Atmosphere…
  3. 10 minutes later I give up and just write the component myself.
1 Like

10 minutes later I give up and just write the component myself.

Exactly. But to let’s no pollute your announcement, and keep the room for your tool. Let’s continue here: Blaze Poweruser Group: “Awesome Blaze”