Motion FX JS behaviour

Spotlight grid

A wall of bordered cards lit by one mouse spotlight: the halo beams from wherever your hand is, the very card under it gets a glowing border and a soft inner wash — none of the cards ever lifts.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

Nova Metrics — everything the dashboard does

Drag your pointer across the wall: one halo follows your hand over the whole grid, and the card you are on lights its own border from inside.

Edge delivery

A delivery network with 28+ points, Frankfurt to Singapore.

28+ PoP

Live queries

Answers under 40ms even on today’s events.

p95 38ms

Session replay

The exact click, the exact pause — with sensitive fields masked.

4K · 60

Guardrails

Budget alerts before the invoice lands, not after.

3 tiers

Enterprise SSO

SAML and SCIM with one toggle, no six-month project.

SAML · SCIM

SDKs

Five frameworks, one API; raw event to dashboard.

5 frameworks

Status & alerts

A public status page and alerts that arrive on time.

99.99%

Important props

Important props
Prop Type Default What it does
radius length '260px' The halo radius across the grid; larger means a softer, hazier beam.
--mfxsg-glow color '#4f46e5' The light colour; it rides the card borders and the grid halo alike.
data-hot state '' The card under the hand turns data-hot: its border feeds off the local light and its text sharpens; keyboard focus builds the same state.
border-mask mask '1px ring' The border glow is masked down to the 1px ring with an exclude mask — the aceternity look’s heart.
prefers-reduced-motion behaviour 'static' The following spotlight is dropped for a static halo centred on the grid.

Snippet

<div class="mfxsg" x-data="spotlightGrid()">
<div class="mfxsg-grid" x-ref="grid" x-bind:data-on="on ? 'yes' : 'no'">
@foreach ($features as $f)
<article class="mfxsg-card">
<h3>{{ $f['title'] }}</h3>
<p>{{ $f['note'] }}</p>
</article>
@endforeach
</div>
</div>

<style>
.mfxsg-grid { position: relative; display: grid; gap: 1rem;
              grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.mfxsg-grid::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
                      background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(79,70,229,.16), transparent 70%); }
.mfxsg-card { position: relative; border: 1px solid #d9dde4; border-radius: 1rem; background: #fff; }
.mfxsg-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
                      background: radial-gradient(220px circle at var(--cx, 50%) var(--cy, 50%), #4f46e5, transparent 70%);
                      mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; }
.mfxsg-card[data-hot] { background: radial-gradient(220px circle at var(--cx) var(--cy), rgba(79,70,229,.09), transparent 65%), #fff; }
</style>
// app/Pages/Features.jsx — Inertia (React) page; renders the React
// snippet below unchanged, with Inertia's Link wired into the provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import SpotlightGrid from '@/components/SpotlightGrid';

export default function Features() {
  return (
    <NabuXUIProvider locale="en" linkComponent={Link}>
      <main className="nx-page">
        <SpotlightGrid />
      </main>
    </NabuXUIProvider>
  );
}
// SpotlightGrid.jsx — one mouse spotlight over a wall of bordered cards
import { useEffect, useRef } from 'react';
import '@nabuxai/ui-core/css';

const FEATURES = [
  { id: 'edge', title: 'Edge delivery', note: '28 regions, Frankfurt to Singapore' },
  { id: 'query', title: 'Live queries', note: 'p95 under 40ms' },
  { id: 'replay', title: 'Session replay', note: 'Watch the exact click' },
  { id: 'guards', title: 'Guardrails', note: 'Budget alerts before the bill' },
  { id: 'sync', title: 'Warehouse sync', note: 'BigQuery and Snowflake' },
  { id: 'sso', title: 'Enterprise SSO', note: 'SAML and SCIM, one toggle' },
];

export default function SpotlightGrid() {
  const gridRef = useRef(null);

  useEffect(() => {
    const grid = gridRef.current;
    const cards = () => Array.from(grid.querySelectorAll('.mfxsg-card'));

    const onMove = (e) => {
      const r = grid.getBoundingClientRect();
      // gradient positions are physical: measure from the left, always
      grid.style.setProperty('--mx', e.clientX - r.left + 'px');
      grid.style.setProperty('--my', e.clientY - r.top + 'px');
      cards().forEach((card) => {
        const c = card.getBoundingClientRect();
        const cx = e.clientX - c.left, cy = e.clientY - c.top;
        card.style.setProperty('--cx', cx + 'px');
        card.style.setProperty('--cy', cy + 'px');
        card.toggleAttribute('data-hot', cx >= 0 && cy >= 0 && cx <= c.width && cy <= c.height);
      });
      grid.dataset.on = 'yes';
    };
    const onLeave = () => {
      grid.dataset.on = 'no';
      cards().forEach((card) => card.removeAttribute('data-hot'));
    };

    grid.addEventListener('pointermove', onMove);
    grid.addEventListener('pointerleave', onLeave);
    return () => {
      grid.removeEventListener('pointermove', onMove);
      grid.removeEventListener('pointerleave', onLeave);
    };
  }, []);

  return (
    <>
      <style>{`
        .mfxsg-grid { position: relative; display: grid; gap: 1rem; padding: 1rem;
                      grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
        .mfxsg-grid::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
                              background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(79,70,229,.16), transparent 70%);
                              opacity: 0; transition: opacity .25s; }
        .mfxsg-grid[data-on='yes']::before { opacity: 1; }
        .mfxsg-card { position: relative; border: 1px solid #d9dde4; border-radius: 1rem; background: #fff;
                      padding: 1.25rem; font: 400 .875rem/1.5 system-ui; }
        .mfxsg-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
                              background: radial-gradient(220px circle at var(--cx, 50%) var(--cy, 50%), #4f46e5, transparent 70%);
                              mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; }
        .mfxsg-card[data-hot] { background:
          radial-gradient(220px circle at var(--cx) var(--cy), rgba(79,70,229,.09), transparent 65%), #fff; }
        .mfxsg-card[data-hot] h3 { color: #4f46e5; }
        @media (prefers-reduced-motion: reduce) {
          .mfxsg-grid::before { background: radial-gradient(300px circle at 50% 30%, rgba(79,70,229,.16), transparent 70%); opacity: 1; }
        }
      `}</style>
      <div className="mfxsg-grid" ref={gridRef} data-on="no">
        {FEATURES.map((f) => (
          <article className="mfxsg-card" key={f.id}>
            <h3>{f.title}</h3>
            <p>{f.note}</p>
          </article>
        ))}
      </div>
    </>
  );
}
<!-- SpotlightGrid.vue — one mouse spotlight over a wall of bordered cards -->
<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref } from 'vue';
import '@nabuxai/ui-core/css';

const features = [
  { id: 'edge', title: 'Edge delivery', note: '28 regions, Frankfurt to Singapore' },
  { id: 'query', title: 'Live queries', note: 'p95 under 40ms' },
  { id: 'replay', title: 'Session replay', note: 'Watch the exact click' },
  { id: 'guards', title: 'Guardrails', note: 'Budget alerts before the bill' },
  { id: 'sync', title: 'Warehouse sync', note: 'BigQuery and Snowflake' },
  { id: 'sso', title: 'Enterprise SSO', note: 'SAML and SCIM, one toggle' },
];
const grid = ref<HTMLElement | null>(null);

const onMove = (e: PointerEvent) => {
  const el = grid.value!, r = el.getBoundingClientRect();
  // gradient positions are physical: measure from the left, always
  el.style.setProperty('--mx', e.clientX - r.left + 'px');
  el.style.setProperty('--my', e.clientY - r.top + 'px');
  el.querySelectorAll<HTMLElement>('.mfxsg-card').forEach((card) => {
    const c = card.getBoundingClientRect();
    const cx = e.clientX - c.left, cy = e.clientY - c.top;
    card.style.setProperty('--cx', cx + 'px');
    card.style.setProperty('--cy', cy + 'px');
    if (cx >= 0 && cy >= 0 && cx <= c.width && cy <= c.height) card.setAttribute('data-hot', '');
    else card.removeAttribute('data-hot');
  });
  el.dataset.on = 'yes';
};
const onLeave = () => {
  grid.value!.dataset.on = 'no';
  grid.value!.querySelectorAll('.mfxsg-card').forEach((card) => card.removeAttribute('data-hot'));
};

onMounted(() => {
  grid.value!.addEventListener('pointermove', onMove);
  grid.value!.addEventListener('pointerleave', onLeave);
});
onBeforeUnmount(() => {
  grid.value?.removeEventListener('pointermove', onMove);
  grid.value?.removeEventListener('pointerleave', onLeave);
});
</script>

<template>
  <div ref="grid" class="mfxsg-grid" data-on="no">
    <article v-for="f in features" :key="f.id" class="mfxsg-card">
      <h3>{{ f.title }}</h3>
      <p>{{ f.note }}</p>
    </article>
  </div>
</template>

<style scoped>
.mfxsg-grid { position: relative; display: grid; gap: 1rem; padding: 1rem;
              grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.mfxsg-grid::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
                      background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(79,70,229,.16), transparent 70%);
                      opacity: 0; transition: opacity .25s; }
.mfxsg-grid[data-on='yes']::before { opacity: 1; }
.mfxsg-card { position: relative; border: 1px solid #d9dde4; border-radius: 1rem; background: #fff;
              padding: 1.25rem; font: 400 .875rem/1.5 system-ui; }
.mfxsg-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
                      background: radial-gradient(220px circle at var(--cx, 50%) var(--cy, 50%), #4f46e5, transparent 70%);
                      mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; }
.mfxsg-card[data-hot] { background:
  radial-gradient(220px circle at var(--cx) var(--cy), rgba(79,70,229,.09), transparent 65%), #fff; }
.mfxsg-card[data-hot] h3 { color: #4f46e5; }
@media (prefers-reduced-motion: reduce) {
  .mfxsg-grid::before { background: radial-gradient(300px circle at 50% 30%, rgba(79,70,229,.16), transparent 70%); opacity: 1; }
}
</style>
<!-- SpotlightGrid.svelte — one mouse spotlight over a wall of bordered cards -->
<script lang="ts">
  import { onMount } from 'svelte';
  import '@nabuxai/ui-core/css';

  const features = [
    { id: 'edge', title: 'Edge delivery', note: '28 regions, Frankfurt to Singapore' },
    { id: 'query', title: 'Live queries', note: 'p95 under 40ms' },
    { id: 'replay', title: 'Session replay', note: 'Watch the exact click' },
    { id: 'guards', title: 'Guardrails', note: 'Budget alerts before the bill' },
    { id: 'sync', title: 'Warehouse sync', note: 'BigQuery and Snowflake' },
    { id: 'sso', title: 'Enterprise SSO', note: 'SAML and SCIM, one toggle' },
  ];

  let grid: HTMLElement;

  const onMove = (e: PointerEvent) => {
    const r = grid.getBoundingClientRect();
    // gradient positions are physical: measure from the left, always
    grid.style.setProperty('--mx', e.clientX - r.left + 'px');
    grid.style.setProperty('--my', e.clientY - r.top + 'px');
    grid.querySelectorAll<HTMLElement>('.mfxsg-card').forEach((card) => {
      const c = card.getBoundingClientRect();
      const cx = e.clientX - c.left, cy = e.clientY - c.top;
      card.style.setProperty('--cx', cx + 'px');
      card.style.setProperty('--cy', cy + 'px');
      if (cx >= 0 && cy >= 0 && cx <= c.width && cy <= c.height) card.setAttribute('data-hot', '');
      else card.removeAttribute('data-hot');
    });
    grid.dataset.on = 'yes';
  };
  const onLeave = () => {
    grid.dataset.on = 'no';
    grid.querySelectorAll('.mfxsg-card').forEach((card) => card.removeAttribute('data-hot'));
  };

  onMount(() => {
    grid.addEventListener('pointermove', onMove);
    grid.addEventListener('pointerleave', onLeave);
    return () => {
      grid.removeEventListener('pointermove', onMove);
      grid.removeEventListener('pointerleave', onLeave);
    };
  });
</script>

<div bind:this={grid} class="mfxsg-grid" data-on="no">
  {#each features as f (f.id)}
    <article class="mfxsg-card">
      <h3>{f.title}</h3>
      <p>{f.note}</p>
    </article>
  {/each}
</div>

<style>
  .mfxsg-grid { position: relative; display: grid; gap: 1rem; padding: 1rem;
                grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
  .mfxsg-grid::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
                        background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(79,70,229,.16), transparent 70%);
                        opacity: 0; transition: opacity .25s; }
  .mfxsg-grid[data-on='yes']::before { opacity: 1; }
  .mfxsg-card { position: relative; border: 1px solid #d9dde4; border-radius: 1rem; background: #fff;
                padding: 1.25rem; font: 400 .875rem/1.5 system-ui; }
  .mfxsg-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
                        background: radial-gradient(220px circle at var(--cx, 50%) var(--cy, 50%), #4f46e5, transparent 70%);
                        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; }
  .mfxsg-card[data-hot] { background:
    radial-gradient(220px circle at var(--cx) var(--cy), rgba(79,70,229,.09), transparent 65%), #fff; }
  .mfxsg-card[data-hot] h3 { color: #4f46e5; }
  @media (prefers-reduced-motion: reduce) {
    .mfxsg-grid::before { background: radial-gradient(300px circle at 50% 30%, rgba(79,70,229,.16), transparent 70%); opacity: 1; }
  }
</style>