Interaction

How things respond to you: hover, focus, pressed, and disabled states, a 3D tilt, and a spotlight that follows the cursor. Interaction is opt in, never baked into a part. Each reads only tokens, is plain HTML and CSS first, then React. Hover, tilt, and spotlight wait for a mouse, so touch screens stay calm, and the calm version keeps every answer without the movement.

See what people who ask their device for reduced motion get: nothing tilts, rises, or presses in, and every color answer stays.

States

Every part that can be used answers in the same four ways. A see-through layer of the part's own text color sits over its background, so it lightens a dark button and darkens a light one in any theme. Hover only happens where a device can hover, so a touch screen never gets stuck in a hover look.

Calm version: the tints stay, since color does not move. Lift and press go still.

  • Rest

    How it sits before anyone touches it.

  • Hover

    An 8 percent tint, only where a device can hover. With Lift, it rises a little.

  • Focus

    A clear 2 pixel ring and a 10 percent tint. Never removed.

  • Pressed

    A 14 percent tint and a small give under the finger.

  • Disabled

    Faded, with no hover. Say why next to it.

Try it: hover, tab to it, and press.

Disabled until the form is filled in.

ReadyAny website, Shopify, WordPress, Square, plain hosting

<link rel="stylesheet" href="tokens.css">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="card.css">
<link rel="stylesheet" href="interaction.css">

<!-- States: add prism-state to any button, link, or card.
     Hover tints where a device can hover. Focus keeps a clear ring. Pressed tints deeper.
     Add prism-state--press for a small give, or prism-state--lift to rise on hover. -->
<button type="button" class="prism-btn prism-btn--primary prism-state prism-state--press">Save changes</button>
<button type="button" class="prism-btn prism-btn--secondary prism-state prism-state--press">Cancel</button>

<!-- Disabled: prefer aria-disabled, so it stays reachable, and say why next to it. -->
<button type="button" class="prism-btn prism-btn--primary prism-state" aria-disabled="true" aria-describedby="why">Publish</button>
<p id="why">Add a title before you publish.</p>

<!-- A whole card that answers as one. -->
<a class="prism-card prism-card--outlined prism-card--comfortable prism-state prism-state--lift" href="/your-page" style="display:block; text-decoration:none">
  <div class="prism-card__inner"><div class="prism-card__body">
    <p class="prism-card__eyebrow">Guide</p>
    <h3 class="prism-card__title">Start here</h3>
  </div></div>
</a>

<!-- For reviews, hold a part in one state: is-hover, is-focus, or is-pressed. -->

3D tilt

The card turns toward the cursor, as if you were tilting it in your hand. It stays gentle, 8 degrees at most by default, because bigger turns can make some people feel unwell. It only follows a mouse or pen. On a touch screen the card stays flat, so scrolling never tilts it.

Calm version: the card stays flat.

Featured

Turns toward you

Move a mouse over this card.

ReadyAny website, Shopify, WordPress, Square, plain hosting

<link rel="stylesheet" href="tokens.css">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="card.css">
<link rel="stylesheet" href="interaction.css">

<!-- 3D tilt: the card turns toward the cursor, at most 8 degrees.
     More or less: style="--prism-tilt-max: 4deg". Flat on touch screens and in the calm version. -->
<article class="prism-card prism-card--outlined prism-card--comfortable prism-tilt">
  <div class="prism-card__inner">
    <div class="prism-card__body">
      <p class="prism-card__eyebrow">Featured</p>
      <h3 class="prism-card__title">Turns toward you</h3>
      <div class="prism-card__content">Move a mouse over it.</div>
    </div>
  </div>
</article>

<script type="module">
  // Tilt and spotlight follow a mouse or pen, never touch. Copy pointer.js next to this page.
  import { prismInteract } from "./pointer.js";
  prismInteract();
</script>

Spotlight

A soft light follows the cursor across a card, a quiet way to say this is live. With the keyboard, the light glows in the middle while focus is inside. It is kept faint, so text on it keeps its contrast.

Calm version: the light stays off.

Plan

Starter

For a first site.

Plan

Studio

For a growing brand.

Plan

Partner

For a full team.

ReadyAny website, Shopify, WordPress, Square, plain hosting

<link rel="stylesheet" href="tokens.css">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="card.css">
<link rel="stylesheet" href="interaction.css">

<!-- Spotlight: a soft light follows the cursor. With the keyboard, it glows while focus is inside.
     Color: --prism-spot-color. Size: --prism-spot-size. Off on touch screens and in the calm version. -->
<article class="prism-card prism-card--outlined prism-card--comfortable prism-spotlight">
  <div class="prism-card__inner">
    <div class="prism-card__body">
      <p class="prism-card__eyebrow">Plan</p>
      <h3 class="prism-card__title">Studio</h3>
      <div class="prism-card__content">A soft light follows the cursor.</div>
    </div>
  </div>
</article>

<script type="module">
  // Tilt and spotlight follow a mouse or pen, never touch. Copy pointer.js next to this page.
  import { prismInteract } from "./pointer.js";
  prismInteract();
</script>