Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Number Animation

Digit Swap

DigitSwap.vue
Card number•••• •••• •••• 0806

Install

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/digit-swap

Import the shared styles once in your application.

TSUsage
import DigitSwap from '@/components/beui/numeric/DigitSwap.vue'
import '@/components/beui/styles.css'

API Reference

value
string | number

Numeric or masked value rendered in fixed character slots.

Default—
animationKey?
string | number

Replays every glyph when the value itself contains unchanged characters.

Default—
direction?
DigitSwapDirection

Direction the next glyph enters from.

Default—
duration?
number

Per-glyph transition duration in seconds.

Default—
stagger?
number

Delay in seconds between neighbouring glyphs.

Default—
suffixLength?
number

Number of final characters that receive `suffixClassName`.

Default—
className?
string
Default—
glyphClassName?
string
Default—
suffixClassName?
string
Default—
Also on React Native. Rolling tickers and count-ups.(opens in a new tab)

Updated