This plugin allows to add responsive custom controls to reveal.js which allow arbitrary positioning, layout, and behaviour of the controls.
To use the plugin include
<!-- Font awesome is used by several plugins --> <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <!-- Custom controls plugin --> <script src="https://cdn.jsdelivr.net/npm/reveal.js-plugins@latest/customcontrols/plugin.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/reveal.js-plugins@latest/customcontrols/style.css">
to the header of your presentation and configure reveal.js and the plugin by
Reveal.initialize({ customcontrols: { // add configuration here }, // ... plugins: [ RevealCustomControls ], // ... });
The plugin can be configured by adding custom controls and changing the layout of the slide number, e.g., by:
Reveal.initialize({ // ... customcontrols: { controls: [ { id: 'toggle-overview', title: 'Toggle overview (O)', icon: '<i class="fa fa-th"></i>', action: 'Reveal.toggleOverview();' } ] }, // ... });
The id
and title
are optional. The configuration should be self explaining and any number of controls can be added. The style file can be altered to control the layout and responsiveness of the custom controls.
MIT licensed
Copyright (C) 2023 Asvin Goel