一键导入
n-back-top
Back Top component for scrolling back to page top. Invoke when user needs to implement a back-to-top button or scroll-to-top functionality in Naive UI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Back Top component for scrolling back to page top. Invoke when user needs to implement a back-to-top button or scroll-to-top functionality in Naive UI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | n-back-top |
| description | Back Top component for scrolling back to page top. Invoke when user needs to implement a back-to-top button or scroll-to-top functionality in Naive UI. |
| metadata | {"author":"jiaiyan","version":"1.0.0"} |
It helps you back to where you were. However, time never goes back.
Use this component when:
Invoke this skill when:
| Name | Type | Default | Description |
|---|---|---|---|
| bottom | number | string | 40 | The height of BackTop from the bottom of the page |
| listen-to | string | HTMLElement | undefined | The element to be listened to scroll event. If it is undefined back top will listen to the nearest scrollable parent. |
| right | number | string | 40 | The width of BackTop from the right side of the page |
| show | boolean | undefined | Whether to show BackTop |
| to | string | HTMLElement | 'body' | Container node to show BackTop |
| visibility-height | number | 180 | BackTop's trigger scroll top. |
| on-update:show | (value: boolean) => void | undefined | Callback is triggered when back-top display changes. |
<template>
<n-back-top :right="100" />
</template>
<template>
<n-back-top
:bottom="100"
:visibility-height="300"
:style="{
transition: 'all .3s cubic-bezier(.4, 0, .2, 1)',
}"
>
<div
style="
width: 200px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 14px;
"
>
Visibility Height: 300px
</div>
</n-back-top>
</template>
<template>
<n-back-top
:right="40"
:bottom="160"
:style="{
transition: 'all .3s cubic-bezier(.4, 0, .2, 1)',
}"
>
<div
style="
width: 200px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 14px;
"
>
Change Position
</div>
</n-back-top>
</template>
<template>
<n-back-top
:listen-to="target"
:bottom="220"
:visibility-height="10"
:style="{
transition: 'all .3s cubic-bezier(.4, 0, .2, 1)',
}"
>
<div
style="
width: 200px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 14px;
"
>
Specify Target
</div>
</n-back-top>
<div
ref="scrollContainer"
style="overflow: auto; height: 72px; line-height: 1.5"
>
<p v-for="i in 10" :key="i">Scroll content line {{ i }}</p>
</div>
</template>
<script setup>
import { ref, computed } from 'vue';
const scrollContainer = ref(null);
const target = computed(() => scrollContainer.value);
</script>
<template>
<n-back-top :right="40" :bottom="80">
<n-button circle size="large">
<template #icon>
<n-icon><ArrowUpIcon /></n-icon>
</template>
</n-button>
</n-back-top>
</template>
<template>
<n-back-top :show="isVisible" @update:show="handleShowChange" />
</template>
<script setup>
import { ref } from 'vue';
const isVisible = ref(false);
const handleShowChange = value => {
isVisible.value = value;
};
</script>
Set appropriate visibility-height: Show button only after meaningful scroll distance
Position for accessibility: Position where it won't obstruct content but is easily accessible
Customize for branding: Match button style with your application theme
Use with specific containers: Set listen-to for scrollable containers other than document
Smooth transitions: Add CSS transitions for better user experience
Mobile considerations: Adjust position for mobile devices to avoid obstruction
基于 SOC 职业分类
FormCreate(运行态渲染器)使用与扩展助手:围绕 rule/option/api 的编写、调试与迁移,覆盖 v-model:api / create 获取实例、字段联动(control/computed)、校验(validate)、远程 fetch、事件注入(inject/formCreateInject)、序列化保存回显(parseJson/toJson)以及多 UI 栈(Antd/Naive/Vant/Arco/TDesign/Element)props/on 差异。权威口径以 `AGENTS.md` 与 `references/types.md` 为准;涉及设计器 ref/config 请用 **FcDesigner使用助手**,涉及安装与包名请选择 **FormCreate安装助手**。
Naive UI Skills Library - A comprehensive skill library for AI agents to understand and utilize Naive UI components. Invoke when user needs to work with Naive UI components, theming, i18n, dark mode, or design specifications.
Work on the Vane server app in apps/server. Use when adding, modifying, reviewing, or debugging server routes, serve-layer data access, middlewares, auth, logging, uploads, database-backed features, or Express response behavior in this repository.
Affix component that makes content stick to fixed places when scrolling. Invoke when user needs to implement sticky positioning or fixed elements in Naive UI.
Alert component for displaying important messages and notifications. Invoke when user needs to show contextual feedback messages with different types and styles in Naive UI.
Anchor component for navigation and table of contents. Invoke when user needs to implement anchor navigation, table of contents, or scroll-based navigation highlighting in Naive UI.