Cursor underscore
StableThe underscore in RChursin_ is a cursor: it blinks on hover and focus, or a few times when it appears.
Three small classes. rc-cursor marks the bar; lux-logo on a link or button around it blinks the cursor three times on hover and keyboard focus; rc-cursor-blink blinks any element four times and then rests. Nothing loops, and nothing moves when the visitor asks for less motion.
On hover and focus
import { useState } from 'react'import { Logo } from '@rchursin/brand/Logo'import { Link } from '@rchursin/product/lib/router'import { Button } from '@rchursin/product/ui'
/** * The underscore in the logo is a cursor. Put lux-logo on the link around it and the cursor * blinks three times on hover or keyboard focus. The blink prop runs four blinks on its own * when the logo appears. Neither loops, and neither moves when the visitor asks for less motion. */export default function CursorHover() { const [replay, setReplay] = useState(0) return ( <div className="@container w-full max-w-2xl"> <div className="grid gap-3 @lg:grid-cols-2"> <figure className="flex flex-col overflow-hidden rounded-2xl bg-surface ring-1 ring-line"> <div className="flex min-h-40 items-center justify-center p-6"> <Link to="/" aria-label="RChursin_, home" className="lux-logo flex items-center rounded-md p-2 text-fg focus-ring"> <Logo className="h-7 w-auto" title="" /> </Link>Usage
import '@rchursin/product.css' // rc-cursor-blink (effects.css) and lux-logo (luxe.css)<Link to="/" aria-label="RChursin_, home" className="lux-logo focus-ring"> <Logo className="h-[18px] w-auto" title="" /></Link>
<span aria-hidden="true" className="rc-cursor-blink inline-block h-[0.11em] w-[0.45em] bg-current" />Examples
On your own text
The same cursor after a line of text. The link blinks its cursor on hover and focus.
import { useState } from 'react'import { Link } from '@rchursin/product/lib/router'import { Button } from '@rchursin/product/ui'
/** * The cursor on your own text: any element with rc-cursor-blink blinks four times and rests. * Inside a lux-logo element, an rc-cursor blinks on hover and focus instead. * The bar is decorative, so it is hidden from screen readers. */export default function CursorPrompt() { const [replay, setReplay] = useState(0) return ( <div className="flex w-full max-w-md flex-col gap-5"> <div className="rounded-2xl bg-inverse px-5 py-4 font-mono text-[13px] text-on-inverse"> <div className="flex items-center justify-between gap-3"> <p className="text-on-inverse/70">Sample session</p> <Button size="xs" variant="inverse" icon="rotate-ccw" onClick={() => setReplay((n) => n + 1)}> Replay </Button> </div> <p className="mt-2"> Waiting for the next run <span key={replay} aria-hidden="true" className="rc-cursor-blink ml-1 inline-block h-[0.11em] w-[0.45em] bg-current align-baseline" /> </p> </div> <p className="flex flex-wrap items-baseline gap-x-3 gap-y-1"> <Link to="/library/marks/logo" className="lux-logo rounded-md font-mono text-[14px] font-medium text-fg focus-ring"> Brand rules <span aria-hidden="true" className="rc-cursor ml-0.5 inline-block h-[0.11em] w-[0.45em] bg-current align-baseline" /> </Link> <span className="text-[12.5px] text-fg-3">Hover or focus the link.</span> </p> </div> )}API
CSS
| Class or variable | What it does |
|---|---|
rc-cursor | A hook, with no style of its own. Logo puts it on the underscore; put it on your own bar to use lux-logo with it. |
rc-cursor-blink | animation: rc-blink 1.1s steps(1) 4 (hard on/off, four times). Off with reduced motion. |
lux-logo | On an ancestor: :hover and :focus-visible blink every .rc-cursor inside three times. Only when motion is allowed. |
Accessibility
Keyboard
| Key | What it does |
|---|---|
| Tab | Focusing a lux-logo link from the keyboard blinks its cursor. |
| Enter | Follows the link, as any link does. |
- The cursor is decoration: inside Logo it belongs to an image with one name, and your own bars should be aria-hidden.
- Blinking stops after three or four cycles (at most 4.4 seconds), under the five seconds WCAG 2.2.2 allows for motion nobody asked for.
- With prefers-reduced-motion: reduce, neither class animates.
Guidelines
Do
- Use the blink for moments: an intro, a loading screen, an empty state.
- Keep the cursor on the baseline, about 0.45em wide and 0.11em tall, as in the logo.
Don’t
- Don’t loop the blink.
- Don’t blink the cursor in static files (favicons, print, social images).
In use
Used on this site
Related
- LogoThe 09 Frame mark and the RChursin_ wordmark in four lockups, drawn as one SVG that takes the text colour.
- TerminalA dark terminal window with sample scan output: usage bars, a context cost and a verdict per item, printed line by line.
- Easing & transitionsFour motion curves, a soft cross-fade for view changes, a reduced-motion hook and disclosures that ease open.
- Site headerThe home pages’ sticky header in three styles: a full bar, a floating glass pill and a minimal mono row.
Source
The component’s own files, exactly as they run on this site.
/* Ported from the RChursin_ UI kit (rchursin/styles/effects.css). Site changes are marked "Site change:": the word field at the end is the one, so `kit.ts diff` reports that block as the only drift. */
/* Effects behind the Magic UI- and Aceternity-style screens, written in plain CSS (no animation library). Light values are the default; anything inside a `.dark` ancestor switches to the dark values. All motion stops for people who ask for reduced motion. Everything sits in @layer components, so Tailwind utilities on the same element win (e.g. `fx-dots [background-size:20px_20px]`).*/
@layer components { @keyframes rc-spin { to { transform: translate(-50%, -50%) rotate(360deg); } } @keyframes rc-shine { from {