CrazyGLCrazyGLHomeExploreGitHubBrowse heroesLoading hero…← Back to gallery@crazygl/selection-color

Selection Color

A long-form heading + body with a styled `::selection` — drag your cursor across it and the highlight is part of the brand. The demo auto-cycles a synthetic selection.

ReactFont#selection#highlight#typography

Usage

import SelectionColor from '@crazygl/hero-selection-color';

export default function Page() {
  return (
    <SelectionColor
      heading="Drag across this line to see how good a selection can look."
      selectionBg="#ffd86b"
      selectionFg="#0a0c14"
    />
  );
}

Customise

  • Contentheading, body.
  • SelectionselectionBg, selectionFg.
  • TypographytextColor, bodyColor, fontSize, headingFontFamily, headingFontWeight.
  • BackdroptransparentBackground, bgColor.

Best for

  • Editorial, blog, and documentation hero sections
  • Brand and design-system landing pages that sweat the details
  • Typography-forward marketing pages
01 · Install the package

One command, zero config.

npm install @crazygl/hero-selection-color
02 · Render the component

Import once, drop it in.

The component takes the same props you see in the live customizer on the right — every default ships poster-quality.

hero.tsx
import SelectionColor from '@crazygl/hero-selection-color';

export default function Landing() {
  return (
    <SelectionColor />
  );
}
03 · Use it in a page

SSR-safe by default.

The wrapper renders static HTML on the server and only initialises the canvas after hydration, so search engines see your copy.

page.tsx
// app/page.tsx — works in SSR-first frameworks (Next, Remix, Astro, etc.)
'use client';

import SelectionColor from '@crazygl/hero-selection-color';

export default function Page() {
  return (
    <section>
      <SelectionColor
        heading="Say hi."
        subheading="Your new hero."
      />
      <article>
        <h2>Welcome</h2>
        <p>Your content keeps its own voice below the hero.</p>
      </article>
    </section>
  );
}
You might also like

Similar heroes

Highlight Cycling

A coloured highlighter sweeps across the line one word at a time — like a presenter underlining the key word as they speak it.

Highlight Text

A heading with marker-highlighter strokes drawn behind specific words — like a printed page someone marked up. Words wrapped in *asterisks* get highlighted with the accent colour.

Hover Text Highlight

A heading whose words light up on hover — a coloured backdrop wipes in from one side, and out the other when the cursor leaves. Pick Background (full bleed) or Underline (band only).

Scroll Text Color

A heading whose colour sweeps from start to end as the user scrolls — uses background-clip:text for crisp gradient handover.

Mouse Wave Text

A wave travels along the heading following the cursor — each letter pops up as the wave passes, then settles back. Switch to auto mode for a hands-off demo.

Gradient Text

Heading filled with a slowly drifting multi-stop linear gradient — three configurable colours, customizable angle, optional animation.
Live customizer

Selection Color

Selection bgSelection textText colourBody colourHeading size64pxFontWeight700Transparent backgroundBackground
CrazyGL · crazygl.comProgrammable hero sections for real websites.