# slot-text

> Zero-dependency text roll: labels change by rolling characters like a slot machine (Copy to Copied).

Source: https://tastebase.ehsanulsiam.workers.dev/browse/slot-text

free

Zero-dependency text roll: labels change by rolling characters like a slot machine (Copy to Copied).

by Daniel (danielwh2)[GitHub](https://github.com/danielwh2/slot-text)[npm](https://npmjs.com/package/slot-text)

[visit](https://textmotion.dev/?utm_source=tastebase&utm_medium=referral&utm_content=detail-page)

[https://textmotion.dev](https://textmotion.dev/?utm_source=tastebase&utm_medium=referral&utm_content=detail-preview)

## Try these

no preview

### [Torph](https://tastebase.ehsanulsiam.workers.dev/browse/torph)

Animated text morphing: labels change letter by letter instead of swapping.

no preview

### [NumberFlow](https://tastebase.ehsanulsiam.workers.dev/browse/number-flow)

Animated number component: digits roll to the new value, formatted with Intl.NumberFormat.

no preview

### [glimm](https://tastebase.ehsanulsiam.workers.dev/browse/glimm)

Shader-driven page transitions for Next.js: links trigger a WebGL wipe between routes.

no preview

### [Sakuga VFX](https://tastebase.ehsanulsiam.workers.dev/browse/sakuga-vfx)

Everyday controls (button, toggle, slider, checkbox, toast) that react like anime: spring squash, impact bursts, manga sound effects.

## For your agent

##### Install

`npm i slot-text`

##### Use it for

- a framework-free label that rolls character by character to a new word, in plain JS or any framework

##### Skip it when

- changing numbers: use number-flow
- React-only morphing between longer strings: torph handles words and layout

##### What's inside10 free

- slotText()
- set()
- flash()
- SlotText (React)
- SlotText (Vue)
- slotText directive (Solid)
- slotText action (Svelte)
- chromatic()
- rollBy (character / word)
- skipUnchanged

##### Facts

**Frameworks**
vanilla, react, vue, svelte

**Styling**
css

**Weight**
tiny

**Accessibility**
ok

**Maturity**
stable

**License**
MIT

**Price**
Free

##### Alternatives

[Torph](https://tastebase.ehsanulsiam.workers.dev/browse/torph)[NumberFlow](https://tastebase.ehsanulsiam.workers.dev/browse/number-flow)

[Compare slot-text with its alternatives](https://tastebase.ehsanulsiam.workers.dev/alternatives/slot-text-alternatives)

```
import "slot-text/style.css"
import { chromatic, slotText } from "slot-text"

const label = slotText(document.querySelector("#copy")!, "Copy")
label.flash("Copied", { enter: { color: chromatic() } })
```

https://textmotion.dev

Loading website

[Visit](https://textmotion.dev/?utm_source=tastebase&utm_medium=referral&utm_content=floating-pill)
