Free Tools & Resources

Free Open Source Bootstrap Right Click Menu JS v1.4.0

Free Open Source Bootstrap Right Click Menu JS v1.4.0

A lightweight, zero-dependency JavaScript module that adds a customizable right-click navigation menu to your Bootstrap website. The menu automatically syncs with your existing navbar structure, supports RTL languages, and respects your theme's CSS variables.

Right-Click Menu. No Code Duplication. Just Bootstrap.

BRC JS automatically builds a right-click menu from your existing Bootstrap navbar. No need to duplicate navigation links—it reads your navbar structure and creates a context menu that matches your site's theme. Perfect for web apps, dashboards, and any Bootstrap site that needs power-user navigation.

Free Open Source Bootstrap Right Click Menu JS v1.4.0

Key Features

  • Full compatibility — Works with right-click on desktop AND long-press on mobile.
  • No Code Duplication — Automatically builds menu from your existing Bootstrap navbar.
  • Theme Aware — Uses Bootstrap CSS variables, supports custom color schemes.
  • RTL Support — Full right-to-left language support.
  • Smooth Scroll — Detects anchor links and scroll smoothly.
  • Accessible — ARIA labels, keyboard navigation, screen reader friendly.
  • Smart Positioning — Automatically positions menu where most space is available.
  • Customizable — Easy to style with CSS variables or configuration options.
  • Lightweight — No external dependencies, just 9.6 kB of vanilla JavaScript.

Installation

Important: If you're fetching the script from a remote location, include integrity and crossorigin="anonymous" to ensure security and prevent tampering.

<script 
src="https://opensource.josebamirena.com/brc/1.4.0/dist/brc.min.js"
integrity="sha384-kJGHY9/CJpLc2cVklwerRBVLBsqBws9DuUwgNfX+LAYB+UyKW/1+/wdzMzkS6koM"
crossorigin="anonymous">
</script>

Basic Initialization

<script>
BootstrapRightClickNav.init();
</script>

Custom Configuration

<script>
BootstrapRightClickNav.init({
minWidth: '250px',
borderColor: 'var(--color-primary, #ff2c6e)',
activeColor: 'var(--color-secondary, #2ecc71)',
debug: true
});
</script>

Configuration Options

OptionTypeDefaultDescription
enabledbooleantrueEnable/disable the right-click menu functionality
injectCSSbooleantrueAutomatically inject required CSS styles
injectHTMLbooleantrueAutomatically inject menu HTML structure
minWidthstring'200px'Minimum width of the menu
zIndexnumber10000Z-index for menu stacking context
menuIdstring'bootstrap-rightclick-nav'ID attribute for the menu element
excludeElementsarray['input', 'textarea', '[contenteditable="true"]']Elements where right-click is disabled
debugbooleanfalseEnable console logging for debugging
navSelectorstring'.navbar-nav'CSS selector to find your navigation element
borderColorstring'var(--color-tertiary, var(--bs-primary))'Menu border color
activeColorstring'var(--color-primary, var(--bs-primary))'Background color for active menu items

API Methods

  • InitializeBootstrapRightClickNav.init(options);
  • EnableBootstrapRightClickNav.enable();
  • DisableBootstrapRightClickNav.disable();
  • HideBootstrapRightClickNav.hide();
  • UpdateBootstrapRightClickNav.update(); (after dynamic nav changes)
  • Check VisibilityBootstrapRightClickNav.isVisible();
  • Update ConfigBootstrapRightClickNav.setConfig({ minWidth: '300px' });
  • DestroyBootstrapRightClickNav.destroy(); (removes events and elements)

CSS Customization

Override default colors via CSS variables:

:root {
--color-primary: #ff2c6e; /* Active item background */
--color-tertiary: #3498db; /* Menu border */
}

Disable on Specific Elements

Add the no-context-menu class to disable right-click:

<div class="no-context-menu">
<!-- Right-click disabled here -->
</div>

Download Bootstrap Right Click Menu JS v1.4.0 Files

Important: Please do not fetch files directly from this website. Remote fetching is blocked for security and performance reasons.

Follow the instructions and use my opensource CDN.

  • brc.min.js— Minified JavaScript code
    8.5 kB. CHECKSUM: 1850acd1a4e6e199dd8e19c6d1c0c30b
  • brc.js— Source JavaScript code, unminified
    15.2 kB. CHECKSUM: d99eeecf9f7cb6c3a2e5fd10046f992d
  • brc-1.4.0.zip— Complete package with docs & examples
    13.7 kB. CHECKSUM: 0f24da2e3658fc031a681afc3f388d79
  • README— MD format documentation
  • LICENSE— MIT license

All Freebies are open source under the MIT License. Free for personal and commercial use. A link back is appreciated but never required.

98

Service Performance


Performance

100

Accessible to All


Accessibility

100

Coding Best Practices


Code Best Practices

100

Search Engine Optimized


Search Engine Optimization

Programmer Gifts

Recommended Products I

Contact Joseba Mirena

Free Tools: What to Know

If you need anything, don't hesitate to contact me—I'm always happy to help!

Do I need to sign up to use these tools?

No. Never. Not happening. There is no hidden 'cost'. These are genuinely free.

I don't ask for emails. I don't ask for signups. Click, copy, use. That's it. I built these for myself and I'm sharing them because sharing is how we all grow.

How should I host these tools?

You can download and host them yourself, or you can use my opensource CDN.

Please do not fetch files directly from this website—remote fetching is blocked for security and performance reasons.

What license are these tools under?

These are free, open source, and MIT licensed. Free for anything.

Personal use. Commercial use. Modify it. Sell it. Whatever works for you. All I ask? If you find it useful, a link back to this site is appreciated. But it's not required. Ever.

Can I modify the code?

Absolutely. It's yours now.

Take it. Modify it. Break it. Fix it. Use it in your projects. Share it with your friends. I built this to be useful, not to be protected. Just don't sell it as your own—that's not cool.

Will these tools be maintained?

Yes, I use them myself—you can see them on this website and across many client projects.

These tools aren't abandoned. I use them in my own apps, so they stay updated, tested, and working. If something breaks, I'll fix it—because I need it too. You can visit this page to stay updated with new versions and improvements.

Can I request a tool?

Maybe. If it sparks my curiosity and/or adds value to me or my clients.

If you need something I haven't built yet, let me know. If it catches my interest, I might build it. If not? You still got free code. No loss.

Free Tools & Resources
Small gifts. Made with care. Shared freely.
Cookie Guard v3.6.0 Cookie Guard v3.6.0
Particles JS v1.2.0 Particles JS v1.2.0
FX CSS Effects v2.0.0 FX CSS Effects v2.0.0
Free Tools & Resources Free Tools & Resources
programmer gifts

Recommended Products

🔺Joseba Mirena Fernandez Florin has no involvement in any of the recommended products; all brands are property of their respective companies.
*Sponsored product selection. As a bookshop.org affiliate, I earn from qualifying purchases. These affiliate links do NOT add any additional cost to the customer.
*Prices and reviews are indicative and subject to change without prior notice.

Joseba Mirena

Online Business Developer

Let's boost your business.

Powered by Google™
Powered by Debian™
Powered by Nginx™
Powered by PHP™
Powered by Amazon AWS™
Code That Scales. Teams That Thrive. Security That Protects.