Compass

Compass: A compass dial with labeled directions and a needle that follows device tilt. Pass a heading prop or let the browser handle orientation. Free MIT React & Next.js source with Motion and Tailwind CSS, live preview, CLI install and docs.

Install Compass

npx motion-ui-skill add compass

Components install as source into your project. The interactive page also includes preview, code, documentation and install tabs.

Dependencies

  • clsx
  • react
  • tailwind-merge

Source files

Compass

A compass dial with labeled directions and a needle that follows device tilt. Pass a heading prop or let the browser handle orientation.

Install

npx motion-ui-skill add compass

Dependencies

  • clsx
  • react
  • tailwind-merge

Usage

"use client";

import { CompassWidget } from "@/components/widgets/compass-widget";

export function CompassWidgetDemo() {
  return (
    <div className="flex items-center justify-center p-6">
      <CompassWidget />
    </div>
  );
}

API Reference

CompassWidget

Prop Type Default Required Description
className string — No Additional CSS classes

Browse this category