Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <nav class="navbar navbar-dark bg-inverse">
  <p class="navbar-brand">Github users</p>

<div class="container-fluid">
  <form class="form-inline">
    <label for="filterInput" class="form-control">Filter: </label>
    <input type="text" name="filter-input" class="form-control" id="filter-input" autocomplete="off" />
    <div class="type-select btn btn-primary" data-value="all">All</div>
    <div class="type-select btn btn-primary" data-value="user">Users</div>
    <div class="type-select btn btn-primary" data-value="organization">Organizations</div>
  <div class="container">
    <div id="loading">
      <div id="loader"></div>
    <div class="error-box"></div>
    <ul class="user-list">

<template id="user-list-item-template">
  <li class="row">
    <img src="{{avatar_url}}" alt="Avatar for user {{login}}" class="user-image avatar img-rounded col-xs-2" />
    <h3 class="user-name col-xs-5">{{login}}</h3>
<template id="error-template">
   <h1 class="error">{{error}}</h1>


                .avatar {
  max-width: 80px;

ul {
  list-style: none;
  margin-top: 40px;

#loading {

  text-align: center;
  #loader {
    margin-top: 20%;
    margin-left: 45%;
    border-top: 2px dotted #3498db;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
  &:before {
    content: 'Loading';
    float: left;

@keyframes spin {
  0% {
    transform: rotate(0deg);
  100% {
    transform: rotate(360deg);

.error {
  color: red;


                const Observable = Rx.Observable;

const $document = $(document),
  $userList = $(".user-list"),
  $filterInput = $("#filter-input"),
  $typeSelectButtons = $(".type-select"),
  $errorBox = $(".error-box"),
  $loader = $("#loading");

const userListItemTemplate = Handlebars.compile(
  errorTemplate = Handlebars.compile($("#error-template").html());

const gettingFilterInput = Observable.fromEvent($filterInput, "keyup")
  .map(event =>

const gettingTypeSelection = Observable.fromEvent($typeSelectButtons, "click")
  .map(event => $("value"))

const gettingUsers = Observable.fromPromise(
).flatMap(user => user);

const ajaxSend = Observable.fromEvent($document, "ajaxSend").subscribe(() => {

const ajaxComplete = Observable.fromEvent(
).subscribe(() => {

function addUserToPage(user) {

function handleError(error) {
  console.log("OMG I'm erroring: %s", error);
      error: error

gettingUsers.subscribe(data => {

  .combineLatest(gettingTypeSelection, (filter, type) => ({
  .do(() => {
  .flatMap(input => {
    if (input.type !== "all") {
      return gettingUsers.filter(
        user =>
          user.login.match(input.filter) &&
          user.type.toLowerCase() === input.type
    } else {
      return gettingUsers.filter(user => user.login.match(input.filter));
  .subscribe(addUserToPage, handleError);