Skip to content

Navbar Custom Navigation Bar

A custom navigation bar at the top of the page, replacing the uni-app native navigation bar. Supports back button, centered title, search bar embedding, frosted glass effect, and safe area adaptation.

Basic Usage

vue
<template>
  <see-navbar title="Page Title" @on-back="onBack" />
</template>

Search Mode

vue
<template>
  <see-navbar :is-search="true" search-placeholder="Search products" @on-search="onSearch" />
</template>

Frosted Glass Effect

vue
<template>
  <see-navbar title="Frosted" :is-frosted="true" />
</template>

Custom Slots

vue
<template>
  <see-navbar>
    <template #left>
      <text>Back</text>
    </template>
    <template #center>
      <text>Custom Title</text>
    </template>
    <template #right>
      <text>Settings</text>
    </template>
  </see-navbar>
</template>

Custom Colors

vue
<template>
  <see-navbar title="Blue Theme" bg-color="#3ca7ff" title-color="#ffffff" />
</template>

Props

PropertyTypeDefaultDescription
titlestring''Navigation bar title
isFixedbooleantrueWhether to fix at the top
isShowLeftbooleantrueWhether to show left area
isShowRightbooleantrueWhether to show right area
leftTextstring''Left side text
leftArrowbooleantrueWhether to show arrow on the left
rightTextstring''Right side text
rightIconstring''Right icon name
isSearchbooleanfalseWhether in search mode
searchPlaceholderstring'Search'Search bar placeholder text
isFrostedbooleanfalseWhether to enable frosted glass effect
zIndexnumber990z-index
safeAreaInsetTopbooleantrueWhether to adapt to top safe area
bgColorstring''Custom background color
titleColorstring''Custom title color
borderbooleantrueWhether to show bottom border
placeholderbooleantrueWhether to generate placeholder element when fixed

Events

EventParametersDescription
onLeftClick-Left button click
onRightClickindex: numberRight button click
onSearchquery: stringSearch trigger
onBack-Back button click

Slots

Slot NameDescription
leftLeft side slot
centerCenter slot (overrides title)
rightRight side slot

Expose

MethodParametersDescription
setTitletitle: stringDynamically set title
setRightTexttext: stringDynamically set right text
show-Show navigation bar
hide-Hide navigation bar

FAQ

How to change navigation bar opacity on scroll?

You can listen to page scroll events and dynamically modify the bgColor property to achieve a scroll opacity gradient effect.

On which platforms does the frosted glass effect work?

The frosted glass effect uses CSS backdrop-filter: blur(), which works on H5 and APP platforms, but may not be supported on mini-program platforms.

Liao ICP No. 2025070134