Text
Pure CSS
Roll text
On hover each letter rolls up and out while its copy rolls in from below — in reading order, word by word in Persian. Pure CSS.
Real scenarios
The component as it is used in a product — not a specimen grid.
A studio header
The nav of a portfolio page — each item is a real link, and the label rolls over letter by letter as the pointer crosses it.
Share row under an article
Three quiet links and one button that actually does something — as="button" keeps it keyboard-operable while it rolls like the rest.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| href | string | null | With href it renders an <a>; without it, `as` decides between span and button. |
| as | string | 'span' | span by default; as="button" makes a real button that can take wire:click. |
| type | string | 'button' | The button type when as="button". |
| static | bool | false | Drops the springy press scaling — for dense rows. |
Snippet
<nav aria-label="ناوبری سایت" style="display: flex; gap: 0 .25rem; font-weight: 700">
<x-nx::roll-text href="/work">نمونهکارها</x-nx::roll-text>
<x-nx::roll-text href="/studio">استودیو</x-nx::roll-text>
<x-nx::roll-text href="/journal">ژورنال</x-nx::roll-text>
<x-nx::roll-text as="button" wire:click="ping('منو')">تماس</x-nx::roll-text>
</nav>