Keyboard Shortcuts
Keyboard shortcuts use the Mousetrap.js framework. Try pressing the key combinations below.
Navigation
| Shortcut | Action |
|---|---|
| g h | Go to Start |
| g b | Go to Blog |
| g s | Go to Getting Started |
| g g | Go to Guidelines |
| g c | Go to Components |
| g a | Go to Accessibility |
| g k | Go to Keyboard Bindings |
| g e | Go to Settings |
| ? | Show this page |
Easter Egg
| Shortcut | Action |
|---|---|
| ↑ ↑ ↓ ↓ ← → ← → B A | Konami Code — try it! |
Implementing in Your Application
Include Mousetrap.js in your project and bind shortcuts:
<script src="mousetrap.min.js"></script>
<script>
// Single key
Mousetrap.bind('/', function(e) {
e.preventDefault();
document.getElementById('search').focus();
});
// Key sequence
Mousetrap.bind('g h', function() {
window.location.href = '/';
});
// Combo
Mousetrap.bind('ctrl+s', function(e) {
e.preventDefault();
saveDocument();
});
</script>
Try it out
Press any of the keyboard shortcuts listed to see them in action. Navigation shortcuts will take you to that page.
Rows highlight briefly when their shortcut is pressed.