Bundles save up to 25%. See every bundle

Code Boss
Dark

Full screen

What it does

A five-tab app bar in frosted glass with a domed lens riding on top of it. The lens really magnifies: inside it is a copy of the tab row, scaled 1.6× and moved every frame so whatever sits under the lens centre lands in the middle of the dome. Tap another tab and the lens glides there on a spring, flattening slightly in the direction it moves while the icons scroll through it at 1.6× speed. On arrival the icon under the lens goes from outline to filled in the accent colour, its label turns to ink, a glint sweeps across the dome and a small spot of light appears on the bar beneath the lens. The lens itself has a bright top glint, a dark refraction ring with a cyan fringe on one side and magenta on the other, and a soft shadow on the bar.

Good for
App-style web UIs, dashboards, mobile web apps, portfolio and product sites that want an iOS-like bottom bar.
How it works
Tap a tab, drag the lens, swipe the bar, or use the arrow keys. While you drag, the lens follows your finger 1:1 and the magnification, squash and tab highlight update every frame; past the ends it resists and springs back. On release it keeps your speed, projects it forward and settles on the nearest tab, so a throw goes further. A quick flick anywhere on the bar moves one tab. The lens is a spring, so you can grab it or redirect it mid-travel without a jump. The icon under the lens fades out as the lens covers it, so only the magnified copy shows.
How to use
Copy two files, paste the markup, call init(). It fires onChange once with the index and value of the selected tab, and onPreview while the lens is dragged over tabs. Swap in your own icons on a 24px grid: silhouette paths fill on selection, detail lines become cut-outs.

Specs

Price
$5, one payment
Version
1.0.0
Code size
7.8 KB gzipped
Dependencies
None
Built with
HTML, CSS, JavaScript
Category
Navigation
Licence
Unlimited personal and client projects
In the zip
  • loupe.css loupe.jsthe component
  • index.htmla plain example page
  • README.mdsetup, CSS variables, API, icon guide, React notes
  • package.json vite.config.js npm install npm run dev
  • LICENSE.md

Use it in your project

  1. Copy loupe.css and loupe.js into your project.
  2. Add the markup from index.html (the block between the COMPONENT comments). Five tabs are in the example; three to six work the same. Each tab is a <button> with an inline SVG icon and a label.
  3. Start it:
import { init } from './loupe.js';
const loupe = init(document.querySelector('.loupe'), {
  onChange: (index, value) => console.log(index, value),
});

Mark the starting tab with aria-selected="true". Each tab's data-value is passed to onChange. The script builds the lens itself: a domed glass disc holding a hidden copy of the tab row, scaled up and moved every frame so the point under the lens centre lands on the lens centre.

### Your own icons

Draw them on a 24px grid, stroke 1.75, round caps. Give the silhouette paths class="loupe-shape" (they fill with the accent when the tab is active) and any inner detail lines class="loupe-line" (they turn into cut-outs on the filled shape). A path with no class keeps its stroke in both states.

Questions

What exactly do I get?

The full source, an example page and a README. No account, no framework.

Can I use it in client projects?

Yes, in unlimited projects. You can't resell or share the source itself.

Does it really magnify, or is it just a bigger icon?

It magnifies. A hidden copy of the whole tab row sits inside the lens, scaled and repositioned every frame, so while the lens travels you see the neighbouring icons pass through it enlarged.

Can I use my own icons?

Yes. Inline SVG on a 24px grid. Give the silhouette class="loupe-shape" and inner lines class="loupe-line"; the README shows the pattern.

Is it keyboard accessible?

Yes. It is a tablist: Tab to the selected tab, then Left, Right, Home and End. The focus ring is drawn around the lens.

Light and dark?

Both are designed: white frosted glass with a clear dome in daylight, smoked glass with a darker marble at night. With no theme set it follows the system setting.

Reduced motion?

The lens crossfades to the new tab instead of travelling, and the icon still fills. A dragged lens still follows your finger, without squash or rubber-band. With reduced transparency the glass turns solid.

Does it work on phones?

Yes. Under 420px the bar spans the width, labels hide and the lens shrinks to 1.3× the tab height. It responds on touch-down, you can drag the lens or swipe the bar with a finger, and vertical swipes over the bar still scroll the page.

Can I turn off dragging?

Yes: init(el, { drag: false }). Taps and keys keep working.

What if it doesn't work for me?

If it doesn't work like the demo, you get a refund within 14 days.

Still have a question? Email us. The person who made it answers.

Your cart

Your cart is empty. Browse components

Full screen