Skip to content

Rolling Icon Navigation

Star
👑Pioneer

RollingNavIcon is a rolling navigation component used to display a large number of icon entries. It is built upon TechUI's powerful core rolling engine, TuiRolling. It inherits the high-performance features of TuiRolling, supporting scrolling by item or page, seamless infinite scrolling, adaptive layout, and smooth motion blur effects.

It is ideal for toolbars, shortcut entry lists, or navigation menus on mobile terminals.

Core Features

  • Powered by TuiRolling: Developed based on the core rolling component, it possesses powerful rolling calculation capabilities, supporting seamless loops and adaptive padding.
  • Dual-Layout: Perfectly supports both Horizontal and Vertical flow directions.
  • Visual:
    • Frame Shape: Supports rounded corners (round), circles (circle), or no border (none).
    • Motion Blur: Built-in motionBlur provides high-quality visual dynamic blur during fast scrolling.
    • Size Control: Precisely control icon size, frame width/height, and adaptive approximate width/height.
  • Interaction Control:
    • Supports Click or Hover to trigger selection.
    • Supports Closeable mode, allowing users to dynamically remove navigation items.
    • Flexible Control Bar position configuration (top, bottom, left, right).

Basic Usage

Horizontal Rolling

The default mode. Suitable for top toolbars or full-width menus. The component automatically calculates the number of items displayed per page based on frameWidth and container width.

html
<script setup>
import { ref } from 'vue';

const activeVal = ref('home');
const navItems = [
  { label: 'Dashboard', value: 'home', icon: 'ti-home' },
  { label: 'Components', value: 'comp', icon: 'ti-package' },
  // ... more data
];
</script>

<template>
  <TuiRollingNavIcon 
    v-model="activeVal" 
    direction="h"
    :frameWidth="100" 
    :iconSize="28"
  >
    <TuiRollingNavIconItem 
      v-for="item in navItems" 
      :key="item.value"
      :value="item.value" 
      :label="item.label" 
      :icon="item.icon" 
    />
  </TuiRollingNavIcon>
</template>

Vertical Rolling

Set direction="v" to switch to sidebar mode. In this mode, the control bar (pagination buttons) will automatically adapt to the layout. It is usually recommended to adjust the position using controlPosition.

html
<template>
  <div style="height: 400px; width: 120px">
    <TuiRollingNavIcon 
      v-model="activeVal" 
      direction="v"
      frameShap="circle"
      controlPosition="bottom"
    >
      <TuiRollingNavIconItem 
        v-for="item in navItems" 
        :key="item.value"
        v-bind="item" 
      />
    </TuiRollingNavIcon>
  </div>
</template>

Interaction and Visual

Trigger and Close

  • trigger: Set to 'hover' to enable selection upon mouse hover.
  • closeable: When enabled, a close button appears when hovering over an Item. Listen to the @remove event to handle deletion logic.
html
<template>
  <TuiRollingNavIcon 
    trigger="hover" 
    closeable
    frameShap="round"
  >
    <TuiRollingNavIconItem 
      v-for="(item, index) in list" 
      :key="item.id"
      v-bind="item"
      @remove="handleRemove(index)"
    />
  </TuiRollingNavIcon>
</template>

Control Bar Position

The pagination controller can be placed at any position—top, bottom, left, or right—via controlPosition to suit different UI designs.

API Reference

Props

PropertyTypeDefaultDescription
modelValueString/Number-The currently selected value (v-model).
directionString'h'Rolling direction. Options: 'h' (Horizontal), 'v' (Vertical).
controlPositionString-Control bar position. Options: top, right, bottom, left.
frameShapString'round'Shape of the icon frame. Options: none, round, circle.
triggerString'click'Activation method. Options: click, hover.
closeableBooleanfalseWhether to enable the delete function.
motionBlurBooleantrueWhether to enable the motion blur effect during scrolling.
iconSizeNumber24Icon size (px).
frameWidthNumber100Outer frame width of a single Item.
frameHeightNumber80Outer frame height of a single Item.
itemApproxWidthNumber140Approximate width for adaptive calculation (used for estimating pagination).
itemApproxHeightNumber80Approximate height for adaptive calculation.
controlTypeString-Style type of the control bar. Options: base, enhanced.
durationNumber-Duration of the rolling animation.
resizeObserverString'global'Size monitoring strategy: self, global, none.

Emits

Event NameDescriptionCallback Parameters
update:modelValueTriggered when the selected value changes.(value)
changeTriggered when the selected item changes.(value, index)
startTriggered when scrolling starts.-
rollingTriggered continuously during scrolling.(offset)

Slots

Slot NameDescription
defaultThe list of <TuiRollingNavIconItem> components should be placed here.

Released under the MIT License.