Magnified Doc

A dock of icons that magnify near the pointer and switch the content of the stage above them.

Examples

Workspace

Each icon is a tab. The stage shows live content per app, and the dot under the icon marks the open one.

Inbox
  • ILCabin list for the coast tripInes Laurent09:12
  • TRFerry times changed on FridayTomas Reyes08:40
  • ADPhotos from the north ridgeAmara DialloMon
Saturday, 14 June
  • 08:30Leave the harbour
  • 12:00Lunch at the ridge hut
  • 18:45Sunset at the dunes
Packing notes

Two warm layers for the ridge, the evenings drop to 9 degrees. The last ferry leaves at 20:10, so dinner stays near the harbour. Bring the long lens for the dunes.

The north ridge at midday
Now playing
Coastline, side BTrack 4 of 9

Wallpapers

Images work as icons too. The stage wipes to the chosen wallpaper with transition='clip'.

Bay wallpaper
Meadow wallpaper
Ridge wallpaper
Valley wallpaper
Dunes wallpaper
Night wallpaper

Installation

npx shadcn@latest add https://ui.ndekocode.dev/r/motion-magnified-doc.json

Component API

MagnifiedDoc

Takes the props of ImageTabs except orientation, which is always horizontal: defaultValue, value, onValueChange, className and children.

MagnifiedDocDock

PropTypeDefaultDescription
childrenReactNodeThe MagnifiedDocItem elements.
magnificationnumber1.6The scale of the icon right under the pointer.
distancenumber120How far from the pointer, in pixels, the icons still grow.
aria-labelstringThe name of the dock.
classNamestringClasses of the dock, laid over the bottom of the stage by default.

MagnifiedDocItem

PropTypeDefaultDescription
valuestringThe value of the panel it opens.
labelstringThe name shown above the icon and read by assistive technology.
childrenReactNodeAn icon or an image.
classNamestringOptional classes of the icon tile.

MagnifiedDocStage, MagnifiedDocPanel, MagnifiedDocImage

The same parts as ImageTabsFrame, ImageTabsPanel and ImageTabsImage: the stage takes transition ('fade' or 'clip'), a panel takes a value and any content, an image takes value, src and alt.