@gkucmierz/nano-ui

High-performance, minimal footprint Vue 3 UI library, interactive 3D charts, and directives.
3,737
Install
npm install @gkucmierz/nano-ui
Latest Version:1.7.9
Vue:3
License:ISC
Last Updated:Oct 1, 2026
Links: Repository  ·  npm
Maintainer: gkucmierz

@gkucmierz/nano-ui

High-performance, minimal-footprint Vue 3 UI library, interactive 3D charts, and directives.
Engineered for glassmorphism aesthetics, continuous Hermite kinematics, and zero-FOUC offline-first applications.

npm version license vue version i18n zero-fouc offline-first

🌐 Live Interactive Playground & Documentation


πŸš€ Key Highlights

  • ⚑ Continuous Hermite Kinematics (KineticRotator): Velocity-preserving $C^1$ continuity on interrupts, geodesic shortest-path interpolation, and dynamic momentum preservation.
  • πŸŽ›οΈ Multi-Resolution DAW Scrubber (PrecisionScrubber): Vertical-distance 2D precision scaling (1x β†’ 0.1x β†’ 0.01x β†’ 0.001x) with floating HUD overlay.
  • πŸ”„ Morphing Sticky Navigation (MutatingHeader): Transitions smoothly between a floating glassmorphism card and an edge-to-edge docked navbar with configurable hysteresis.
  • πŸ“Š 3D SVG Data Visualizations (ThreeDDonutChart): Interactive 3D perspective donut & pie charts with auto-balancing side callouts, depth slope ratio, and slice locking.
  • 🎚️ Accessible Glass Controls (NanoSwitch, NanoModal): Lightweight toggle switches and hash-routed modals with universal dismissal triad (ESC, backdrop click, header close).
  • πŸ’§ Optimized Micro-Directives (v-ripple, v-tooltip): Material ripples and GPU-accelerated tooltips with minimal runtime overhead.
  • 🌍 Zero-Dependency i18n: Built-in reactive English/Polish localization engine featuring line-correlated translation dictionaries.
  • πŸ›‘οΈ Zero-Trust Offline-First: Zero external runtime CDNs (esm.sh, unpkg, cdnjs) β€” 100% bundled locally for offline PWA reliability.

πŸ“¦ Installation

npm install @gkucmierz/nano-ui

πŸ› οΈ Quick Start

Global Registration

Register Nano UI and its core design tokens globally in your Vue 3 application:

import { createApp } from 'vue';
import App from './App.vue';
import NanoUI from '@gkucmierz/nano-ui';
import '@gkucmierz/nano-ui/style.css'; // Core design tokens, animations, and typography

const app = createApp(App);

app.use(NanoUI);
app.mount('#app');

Individual Component Import

You can also import individual components and directives on demand:

import { 
  KineticRotator, 
  MutatingHeader, 
  PrecisionScrubber, 
  NanoSwitch, 
  ThreeDDonutChart,
  NanoModal,
  Ripple,
  tooltipDirective 
} from '@gkucmierz/nano-ui';
import '@gkucmierz/nano-ui/style.css';

🧩 Component Catalog & API

πŸŒ€ KineticRotator

A high-performance angular rotator component powered by Cubic Hermite spline kinematics. Unlike standard CSS transitions which snap or restart upon target changes, KineticRotator samples the instantaneous angular velocity ($v_0$) at the moment of interruption, guaranteeing $C^1$ velocity continuity and zero jarring visual jerks.

Features
  • Continuous Velocity Preservation ($C^1$ Continuity): Seamless retargeting mid-flight with boundary conditions $P(0) = 0$, $P'(0) = v_0$, $P(1) = 1$, $P'(1) = 0$.
  • Geodesic Shortest-Path Navigation: Modulo $360^\circ$ difference wrapping minimizes rotational distance while preserving rotational momentum.
  • Dynamic Timing Modes:
    • proportional (Isokinetic, $v \approx \text{const}$): Duration scales proportionally with angular displacement ($|\Delta\theta|$).
    • fixed (Isochronous, $T = \text{const}$): Duration is constant regardless of angle distance.
  • In-Flight Duration Adaptation: Dynamically updates duration without spatial jumps on the normalized time axis.
Code Example
<template>
  <div class="rotator-container">
    <KineticRotator
      ref="rotatorRef"
      v-model="angle"
      :duration="1000"
      :speed-multiplier="1"
      timing-mode="proportional"
      :shortest-path="true"
      :inertia-threshold="0.25"
      :size="260"
      @frame="onFrame"
      @settled="onSettled"
    >
      <template #default="{ currentAngle, velocity, isMoving }">
        <div class="custom-compass-tile">
          <span class="compass-pointer">⬆</span>
          <span class="telemetry">{{ Math.round(currentAngle) }}Β° ({{ Math.round(velocity) }}Β°/s)</span>
        </div>
      </template>
    </KineticRotator>

    <div class="controls">
      <button @click="rotatorRef?.rotateBy(90)">+90Β°</button>
      <button @click="rotatorRef?.rotateBy(-90)">-90Β°</button>
      <button @click="rotatorRef?.reset()">Reset</button>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { KineticRotator } from '@gkucmierz/nano-ui';

const angle = ref(0);
const rotatorRef = ref(null);

const onFrame = (telemetry) => {
  // telemetry: { currentAngle, targetAngle, velocity, acceleration, progress, isMoving, timestamp }
};

const onSettled = ({ angle, normalizedAngle }) => {
  console.log('Rotator settled at:', angle, 'modulo:', normalizedAngle);
};
</script>
Props
Prop Type Default Description
modelValue Number 0 Target angle in degrees. Supports v-model.
duration Number 1000 Base duration in milliseconds for a $90^\circ$ rotation step.
speedMultiplier Number 1 Speed scaling factor (e.g., 0.5 = half speed, 2.0 = double speed).
step Number 90 Reference step angle in degrees used for proportional duration scaling.
shortestPath Boolean true When true, targets are reduced modulo $360^\circ$ along the shortest geodesic arc.
timingMode String 'proportional' 'proportional' (isokinetic, $v \approx \text{const}$) or 'fixed' (isochronous, $T = \text{const}$).
inertiaThreshold Number 0.25 Momentum threshold (in seconds) to avoid abrupt directional reversals during high-speed motion.
size Number | String 260 Width and height of the rotator bounding box in pixels or CSS units.
Events
Event Payload Description
update:modelValue Number Emitted when motion settles to update the v-model binding.
change Number Emitted immediately when a new target destination is committed.
settled { angle, normalizedAngle } Emitted once motion comes to a complete rest.
frame Object Emitted every requestAnimationFrame with live kinematics telemetry.

🎚️ PrecisionScrubber

A 2D jog-dial precision scrubbing widget inspired by digital audio workstations (DAWs) and professional video editing suites. Dragging horizontally adjusts the parameter value, while dragging vertically increases resolution precision exponentially (up to $0.001\times$) with a floating HUD anchor guide.

Code Example
<template>
  <PrecisionScrubber
    v-model="frequency"
    :min="20"
    :max="20000"
    :step="1"
    label="Cutoff Frequency"
    unit="Hz"
    :sensitivity="1"
    :relative="true"
  />
</template>

<script setup>
import { ref } from 'vue';
import { PrecisionScrubber } from '@gkucmierz/nano-ui';

const frequency = ref(440);
</script>
Props
Prop Type Default Description
modelValue Number Required Current numerical value (v-model).
min Number 0 Minimum allowed value boundary.
max Number 100 Maximum allowed value boundary.
step Number 1 Increment step size at base $1\times$ resolution.
label String '' Descriptive label displayed on the scrubber track.
unit String '' Value unit suffix (e.g., 'ms', 'px', '%', 'Hz').
sensitivity Number 1 Horizontal drag sensitivity multiplier.
relative Boolean true Enables vertical distance dynamic precision scaling.

πŸ”„ MutatingHeader

A reactive, scroll-docking navigation container that dynamically morphs between an elevated floating glassmorphism card and an edge-to-edge docked navbar as the user scrolls.

Code Example
<template>
  <MutatingHeader
    :threshold="24"
    :hysteresis="8"
    height="60px"
    floating-margin="12px 24px 0 24px"
    floating-radius="16px"
    :glassmorphism="true"
    @change="onDockStateChange"
  >
    <div class="nav-content">
      <span class="brand">Project Nexus</span>
      <nav class="links">
        <a href="#overview">Overview</a>
        <a href="#features">Features</a>
      </nav>
    </div>
  </MutatingHeader>
</template>

<script setup>
import { MutatingHeader } from '@gkucmierz/nano-ui';

const onDockStateChange = (isDocked) => {
  console.log('Header docked status:', isDocked);
};
</script>
Props
Prop Type Default Description
threshold Number 24 Scroll distance in pixels after which the header docks edge-to-edge.
hysteresis Number 8 Scroll delta in pixels below threshold required to un-dock back into floating card.
scrollContainer String | Object null Target scroll container selector or DOM element (defaults to window).
height String '60px' Height of the header bar.
floatingMargin String '12px 24px 0 24px' Outer margins when floating at the top of the viewport.
floatingRadius String '16px' Corner border radius when in floating card state.
glassmorphism Boolean true Enables blurred backdrop filter glassmorphism effect.
stuck Boolean undefined Controlled dock state override via v-model:stuck.

πŸ”˜ NanoSwitch

A lightweight, accessible toggle switch component featuring glassmorphism styles, keyboard accessibility (Space / Enter), and smooth state transitions.

<template>
  <NanoSwitch
    v-model="isEnabled"
    label="Hardware Acceleration"
    size="md"
  />
</template>

<script setup>
import { ref } from 'vue';
import { NanoSwitch } from '@gkucmierz/nano-ui';

const isEnabled = ref(true);
</script>

πŸ“Š ThreeDDonutChart

A premium 3D SVG Donut and Pie Chart component for Vue 3. Features smooth morphing animations, dynamic 2D/3D perspective transitions, responsive side-label columns with callout leader lines, auto-rotation label balancing, and slice selection locking.

<template>
  <div class="chart-container">
    <ThreeDDonutChart 
      v-model:selectedItemId="selectedId"
      :data="chartData"
      :isExpanded="true"
      :showLabels="true"
      :is3D="true"
      :slopeRatio="0.55"
      :autoRotate="true"
      :selectable="true"
      valueDecimals="2"
      centerLabel="Total Portfolio"
    />
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { ThreeDDonutChart } from '@gkucmierz/nano-ui';

const selectedId = ref(null);
const chartData = ref([
  { id: '1', name: 'Ethereum', value: 140, color: '#3b82f6', unit: 'ETH' },
  { id: '2', name: 'Solana', value: 95, color: '#10b981', unit: 'SOL' },
  { id: '3', name: 'Bitcoin', value: 55, color: '#f59e0b', unit: 'BTC' }
]);
</script>
Props
Prop Type Default Description
data Array Required Array of objects: { id, name, value, color, unit }.
isExpanded Boolean false Large container layout with callout margins (true) or compact mini layout (false).
showLabels Boolean true Show/hide side callouts and leader lines (applicable when isExpanded is true).
is3D Boolean true Enables 3D perspective rendering (depth and tilt). When false, renders in flat 2D.
slopeRatio Number 0.5 Vertical tilt factor of the 3D plane (from 0.2 to 1.0).
rotationAngle Number -90 Starting rotation angle of the chart in degrees.
autoRotate Boolean false Dynamically optimizes rotation to balance side labels evenly.
selectable Boolean false Enables slice selection/locking on click or tap.
selectedItemId String | Number null ID of the currently locked slice (v-model:selectedItemId).
centerValue String | Number '' Custom text inside donut hole (defaults to sum of all items).
centerLabel String '' Sub-label text displayed below center value.
centerValueFormatter Function null Formatter function: (value, item) => string.
valueDecimals Number undefined Decimals to round slice values on callouts.
aggregateOthers Boolean false Merges slices below threshold into an "Other" item.
othersThreshold Number 0.01 Fraction threshold (e.g. 0.05 for 5%) for "Other" aggregation.

πŸͺŸ NanoModal

Standardized modal dialog adhering to the Universal Dismissal Triad (ESC key with event.stopPropagation(), backdrop click @click.self, and header close βœ•), with deep-linking URL hash synchronization support.

<template>
  <NanoModal
    v-model="isOpen"
    title="System Configuration"
    icon="βš™οΈ"
    max-width="540px"
    @close="isOpen = false"
  >
    <div class="modal-body">
      <p>Configure hardware telemetry parameters and sync preferences.</p>
    </div>
  </NanoModal>
</template>

<script setup>
import { ref } from 'vue';
import { NanoModal } from '@gkucmierz/nano-ui';

const isOpen = ref(false);
</script>

πŸ’§ Directives

v-ripple

Material-style ripple effect directive with configurable colors:

<template>
  <button v-ripple class="btn">Default Ripple</button>
  <div v-ripple="'rgba(0, 242, 254, 0.3)'" class="card">Custom Cyan Ripple</div>
</template>
v-tooltip

Lightweight, accessible tooltip directive powered by @gkucmierz/nano-ui composable state:

<template>
  <button v-tooltip="'Synchronize system telemetry'">Sync Now</button>
  <span v-tooltip="{ text: 'High-precision sensor', position: 'bottom' }">Sensor A</span>
</template>

🌐 Built-in i18n Architecture

Nano UI includes a zero-dependency, ultra-lightweight reactive internationalization engine (src/locales.js) featuring strictly line-correlated JSON translation dictionaries:

import { t, currentLang, setLang, toggleLang } from '@gkucmierz/nano-ui/locales';

// Switch language reactively
setLang('pl'); // 'en' | 'pl'
toggleLang();

// Translate keys with parameter interpolation
const label = t('rotator.isokinetic');

The translation files (src/locales/en.json and src/locales/pl.json) are maintained in strict 1:1 line synchronization, enabling seamless structural diffing and zero missing-key drift.


⚑ Zero-FOUC Architecture

Nano UI provides synchronized design tokens with automatic system and dark-mode adaptation. Zero Flash of Unstyled Content (FOUC) is guaranteed through immediate inline CSS variable evaluation before Vue hydration:

:root {
  --nano-bg-main: #060913;
  --nano-bg-card: rgba(15, 23, 42, 0.75);
  --nano-border-card: rgba(255, 255, 255, 0.12);
  --nano-state-active: #00f2fe;
  --nano-state-accent: #6366f1;
  --nano-radius-md: 10px;
  --nano-radius-lg: 16px;
}

πŸ›‘οΈ Zero-Trust Offline-First

In accordance with workspace reliability standards:

  • No External CDNs: Zero runtime script imports from unpkg.com, esm.sh, jsdelivr, or cdnjs.
  • Bundled Assets: All SVG graphics and fonts resolve locally to guarantee 100% offline functionality in air-gapped environments or Progressive Web Apps (PWAs).

πŸ“œ Scripts & Development

# Start local Vite development server & playground
npm run dev

# Build the production library distribution (dist/nano-ui.js & dist/nano-ui.css)
npm run build

# Build the standalone documentation & playground application
npm run build:app

# Regenerate master branding assets (SVG -> 512x512 PNG)
npm run icons

πŸ“„ License

MIT © Grzegorz Kućmierz

Related Packages

@aresrpg/ui

Glassmorphism Vue 3 UI component library for AresRPG projects

4,633
croud-frontend

A collection of generic front-end resources for crouyd applications

861 5
vue-circular-gauge

Circular gauge component for Vue.js with customizable colors, animations, and th...

4,173 21
nemesischart

Lib de componentes Vue 3 para charts usando Chart.js, sem dependΓͺncias de UI ext...

6,006 0

Version History

Version Released License
1.7.9 ISC
1.7.8 ISC
1.7.7 ISC
1.7.6 ISC
1.7.5 ISC