bespokejs/bespoke is a open-source project on GitHub, written primarily in JavaScript. It has 4.8k stars. DIY Presentation Micro-Framework
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Bespoke.js is a super minimal (1KB min'd and gzipped), modular presentation library for modern browsers, designed to foster a rich plugin ecosystem.
The core library sets up the presentation, provides a simple control API and manages events. Any other functionality is implemented as a plugin.
Joining the Bespoke.js ecosystem is simple with the suite of official Yeoman generators:
Bespoke.js Generator
Bespoke.js Plugin Generator
Bespoke.js Theme Generator
Creating a Presentation
Due to the highly modular nature of Bespoke.js, the quickest way to get started is with Bespoke.js Generator, a Yeoman generator that scaffolds a boilerplate presentation with a Gulp build system.
Assuming you have Node.js installed, in a blank directory:
$ npm install -g generator-bespoke
$ yo bespoke
In your newly scaffolded project, you can use the following Gulp tasks:
$ gulp serve to run a preview server with LiveReload.
$ gulp deploy to deploy to GitHub Pages.
$ gulp to compile static assets to 'public'.
For more detailed instructions, check out the Bespoke.js Generator repo.
If you'd prefer to craft a new presentation from scratch, you can install Bespoke.js from npm with npm install bespoke, Bower with bower install bespoke.js, or manually download either the production version or the development version. The Bespoke.js core is extremely lightweight, so you'll probably want to include some plugins.
Basic Usage
Loading Bespoke
Bespoke.js is shipped in a UMD format, meaning that bespoke and its plugins are available as CommonJS/AMD modules or browser globals.
Markup
It's completely up to you which tags you use, but the following is a good starting point:
To create a new presentation, Bespoke.js provides the from(selector[, plugins]) method, which takes a selector or element reference and an array of plugins, and returns a deck instance.
var deck = bespoke.from('#presentation', [plugins]);
// Next slide
deck.next();
// Previous slide
deck.prev();
// Go to a specific slide
deck.slide(0);
// Get the active slide index
deck.slide(); // 0
By default, all non-script child elements of the resolved parent element become slides.
You can customize this behavior by passing a custom selector.
Plugins
Official Plugins
All official plugins can be installed from npm or Bower, e.g. $ npm install bespoke-keys or $ bower install bespoke-touch
bespoke-keys for keyboard and remote control interaction.
bespoke-touch for touch interaction.
bespoke-classes for deck status classes.
bespoke-bullets for animated bullet lists.
bespoke-scale for responsive slide scaling.
bespoke-hash for hash routing.
bespoke-backdrop for animated backdrop elements.
bespoke-state for slide-specific deck styles.
bespoke-progress for progress bars.
bespoke-forms for form element support.
bespoke-loop for looped presentations.
bespoke-vcr for recording and playback.
All Plugins
You can view the full list of Bespoke.js plugins on npm by browsing the bespoke-plugin keyword.
Using Plugins
All official plugins are provided in a UMD format, meaning they are available as CommonJS/AMD modules or browser globals.
For example, if you're using CommonJS modules via browserify or webpack, it would look something like this:
If you're using browser globals, all official plugins are added to the bespoke.plugins object, for example:
var deck = bespoke.from('#presentation', [
bespoke.plugins.classes(),
bespoke.plugins.keys(),
bespoke.plugins.touch()
]);
The first slide is activated automatically after all plugins are called unless one of those plugins has already activated a slide.
Themes
Official Themes
Cube — (view demo)
Voltaire — (view demo)
Nebula — (view demo)
As with plugins, all official themes can be installed from npm or Bower, e.g. $ npm install bespoke-theme-cube or $ bower install bespoke-theme-voltaire
All Themes
You can view the full list of Bespoke.js themes on npm by browsing the bespoke-theme keyword.
If you're using browser globals, all official themes are added to the bespoke.themes object, for example:
var deck = bespoke.from('#presentation', [
bespoke.themes.cube(),
bespoke.plugins.keys(),
bespoke.plugins.touch()
]);
Advanced Usage
From HTMLElement
If you already have a reference to a DOM node, you can pass it directly to the from method.
bespoke.from(element);
Slide Selector
You can specify which elements become slides by passing an options Hash containing the key parent and, optionally, the key slides) to the from method.
The value of either key can be a CSS selector or a DOM node.
This advanced usage allows you to include auxiliary HTML inside the parent element, skip slides that don't match the selector or explicitly filter out slides before passing on the collection.
Deck Instances
Deck instances are provided to plugins and returned when instantiating a presentation. The following properties are available on each instance.
Note: The optional eventData parameter is an object that will be merged with the event object in subsequent event handlers.
next([eventData])
Next slide.
prev([eventData])
Previous slide.
slide([index[, eventData]])
Get or set the active slide index.
on(event, callback)
Attach event handlers
off(event, callback)
Unbind event handlers
fire(event[, eventData])
Fire custom events. This method is primarily designed for plugin authors.
parent
The deck's parent element
slides
An array of slide elements
destroy
Fire the destroy event. This method can be used to remove the deck from the DOM.
Events
Binding Events
Events are bound via the deck instance. Each event is passed an event object containing a reference to the relevant slide and its index.
Want a boilerplate plugin? Use the official Bespoke.js Plugin Generator.
If you'd like to learn by example, check out the list of existing plugins.
Basic Plugins
Plugins are simply functions that are called when presentations are created. They are passed a deck instance which allows you to interact with the deck's state, bind events and modify its elements.
To be consistent with the suite of official Bespoke.js plugins, it is highly recommended that you implement your plugin as a function that takes configuration and returns a plugin function.
The plugin can now be provided in the plugins array when using the from(selector[, plugins]) method.
// Using the plugin
bespoke.from('#presentation', [
myPlugin()
]);
Plugins with Options
If your plugin needs some configurability, your plugin factory function can take options and return a configured plugin function.
// Creating the plugin with options
var myPlugin = function(options) {
return function(deck) {
var showTotal = options && options.showTotal;
deck.on('activate', function(e) {
console.log('Activated slide ' + (e.index + 1) +
(showTotal ? ' of ' + deck.slides.length : ''));
});
}
};
// Using the plugin with options
bespoke.from('#presentation', [
myPlugin({ showTotal: true })
]);
Custom Event Data
Additional event data can be supplied to next, prev and slide, which is merged with the final event object in subsequent event handlers.
This functionality is particularly useful if you need to differentiate between events caused by your plugin, and those caused by your end users or other plugins.
var myPlugin = function() {
return function(deck) {
// Differentiating our plugin's events
deck.on('activate', function(event) {
if (event.foo === 'bar') {
// Triggered by my plugin...
} else {
// Triggered by end user, or another plugin...
}
});
// Providing custom event data
deck.next({
foo: 'bar'
});
};
}
Creating Themes
Themes are essentially just plugins that also happen to insert styles into the page.
You can quickly scaffold a boilerplate theme project with the official Bespoke.js Theme Generator.
Presentations
A State of Change — On the future of Object.observe by Mark Dalgleish
Build Wars: Gulp vs Grunt by Mark Dalgleish
Bespoke.js: The Road to 1KB by Mark Dalgleish
DIY Presentations With Bespoke.js by Mark Dalgleish
Javascript's Slightly Stricter Mode by Glen Maddern
The Trials of Transition Height: Auto by Charlie Gleason
Welcome Our New ES5 Overlords by Mike MacCana
Rapid Web App Dev With Yeoman by Michael Taranto
Projects vs Products by John Barton
Learn You The Node.js For Much Win by Rod Vagg
A Real Database Rethink by Rod Vagg
Feature Flags with Directives by Michael Taranto
Introduction to hapi by Mark Wolfe
How to Cook a Graph Database in a Night by Matteo Collina
Asynchronous JavaScript Interfaces by Mariusz Nowak
MQTT and Node.js - Messaging in the Internet of Things by Matteo Collina
At Least 6 Ways to Win with CSS Modules by Josh Johnston
bespokejs/bespoke has 4.8k GitHub stars — refresh the page for the live number, or check github.com/bespokejs/bespoke. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is bespokejs/bespoke open source?
Yes — bespokejs/bespoke ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/bespokejs/bespoke.
What is bespokejs/bespoke?
bespokejs/bespoke (bespokejs/bespoke) is a JavaScript project on GitHub. From the project's own README: DIY Presentation Micro-Framework
Where can I see bespokejs/bespoke in action?
The project maintains a homepage at http://markdalgleish.com/projects/bespoke.js/. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about bespokejs/bespoke?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/bespokejs/bespoke is the definitive source.
Read full README in the tab above.
Want a second opinion on bespoke?
Ask an AI that can read this page — one click and you get its take on bespoke.