Vagibond
Vagibond

Follow Vagibond

Stay connected with us on social media for updates on new ventures.

Thanks for subscribing!
Visit SidePiece Site

SidePiece API

Getting App Size Sensitivity has never been easier.When your main menu just isn't enough anymore, let SidePiece slide in with quick in-and-out access. Auto-detect navigation links and inject a responsive hamburger menu with one line of code. Your main nav doesn't need to know.

📱
At least it's upfront about what it's up to
SidePiece handles your responsive navigation needs honestly. Unlike certain people, this API does exactly what it promises.

What SidePiece does

Live Demo

See SidePiece in action. Resize your browser to see the hamburger appear at 768px.

SidePiece Demo

Quickstart

Start exposing what's in your drawers in under 30 seconds. Unlike my marriage counselor, SidePiece doesn't require multiple sessions.

1. Add the script

Drop in one line. That's it. SidePiece auto-initializes and detects your nav links.

html
<!-- Add before </body> -->
<script src="https://sidepiece.vagibond.com/sidepiece-core.js"></script>

2. That's literally it

SidePiece automatically:

Basic Embed

For most sites, the zero-config approach works perfectly. Just add the script.

html
<!-- Your existing nav -->
<nav class="nav">
  <a href="/" class="nav-brand">My Site</a>
  <div class="nav-links">
    <a href="/features">Features</a>
    <a href="/pricing">Pricing</a>
    <a href="/contact">Contact</a>
  </div>
</nav>

<!-- SidePiece does the rest -->
<script src="https://sidepiece.vagibond.com/sidepiece-core.js"></script>

Configuration

Override defaults by calling SidePiece.init() with options.

javascript
<script src="https://sidepiece.vagibond.com/sidepiece-core.js"></script>
<script>
SidePiece.init({
  // Custom selector for nav detection
  selector: '.my-custom-nav',

  // Override detected links
  links: [
    { label: 'Home', href: '/' },
    { label: 'About', href: '/about' },
    { label: 'Contact', href: '/contact', className: 'cta' }
  ],

  // Custom breakpoint (default: 768)
  breakpoint: 900,

  // Custom top offset (default: 30)
  topOffset: 50,

  // Drawer width (default: 280)
  drawerWidth: 300
});
</script>

Configuration Options

Option Type Default Description
selector string .nav-menu, .nav-links, .nav-tabs CSS selector for nav element to detect links from
links array [] Explicit links array (overrides auto-detection)
breakpoint number 768 Viewport width at which hamburger appears
topOffset number 30 Pixels from top (for Universal Network Bar)
drawerWidth number 280 Width of the slide-out drawer in pixels

Theming

Match your brand with the theme object.

javascript
SidePiece.init({
  theme: {
    background: '#1a1a2e',      // Drawer background
    text: '#ffffff',            // Primary text
    textMuted: 'rgba(255,255,255,0.7)', // Secondary text
    accent: '#e94560',          // CTA buttons
    overlay: 'rgba(0,0,0,0.5)', // Backdrop
    border: 'rgba(255,255,255,0.1)' // Borders
  }
});

JavaScript API

Control the drawer programmatically.

javascript
// Initialize with config
SidePiece.init(config);

// Open the drawer
SidePiece.open();

// Close the drawer
SidePiece.close();

// Toggle open/closed
SidePiece.toggle();

// Check if open
if (SidePiece.isOpen()) {
  console.log('Drawer is open');
}

// Remove all injected elements
SidePiece.destroy();

Link Detection

SidePiece scans for these selectors in order:

  1. .nav-menu
  2. .nav-links
  3. .nav-tabs

It extracts all <a> tags with href attributes. Links with className containing "cta" render as buttons.

CSS Override

All styles use the .sidepiece- prefix. Override with higher specificity:

css
/* Custom hamburger color */
.sidepiece-btn span {
  background: #ff6b6b !important;
}

/* Custom drawer background */
.sidepiece-drawer {
  background: linear-gradient(135deg, #1a1a2e, #2d2d5a) !important;
}

/* Custom link hover */
.sidepiece-drawer a:hover {
  color: #ff6b6b !important;
}

Accessibility

SidePiece includes built-in accessibility features:

Changelog

v1.0.0 February 2026

Support

Having trouble with SidePiece? Unlike my marriage counselor, we're here to help.

💭
A note from the documentation team
At least SidePiece is upfront about what it's up to. It slides in when you need it and slides out when you don't. No gaslighting. No "we need to talk" at 11pm. Just clean, responsive navigation. — Gary B.