Skip to content

Text Reveal ​

Vue 已实现 · 还原验收 0/1 · 上游演示 · 固定版本源码

预览 ​

Motion that feels considered.

Word by word, with a soft blur.

用法 ​

vue
<script setup lang="ts">
import { ButtonBase, TextReveal } from 'beui-vue'
import { shallowRef } from 'vue'
const replay = shallowRef(0)
</script>
<template>
  <div class="reveal-demo"><div :key="replay">
    <TextReveal as="h2" :text="['Motion that feels', 'considered.']" class="title" />
    <TextReveal text="Word by word, with a soft blur." :delay=".9" :stagger=".05" :blur="6" y-offset="20%" class="subtitle" />
  </div><ButtonBase variant="secondary" size="sm" @click="replay++">Replay</ButtonBase></div>
</template>
<style scoped>.reveal-demo { text-align: center; display: grid; justify-items: center; gap: 2rem; } .title { font-size: clamp(2rem, 6vw, 3rem); line-height: .95; font-weight: 600; letter-spacing: -.04em; border: 0; margin: 0; padding: 0; } .subtitle { margin-top: .75rem; font-size: .875rem; color: var(--beui-muted-foreground); }</style>

API ​

text 支持单行或多行,split 设为 word 或 char。delay、stagger、blur、yOffset、spring 调整入场。whileInView 和 once 控制视口触发。

上游变体 ​

还原验收 ​

基于 beUI 的独立 Vue 移植,依 MIT 许可证分发。