nook
Browse the docs

Components

Spotlight

Native

A card with a glow of the brand color that follows the pointer.

See the prompt

Plans that stay true

Move a task and every view updates.

Numbers people read

Every chart has a table behind it.

Installation

npx nook-ui@latest add spotlight

Prompt

Paste this into your AI coding assistant. It adds this exact component, the same way the CLI does, and tells the assistant how to use it.

Short. For assistants that can run commands in your project.

Plain text
Add the Nook "Spotlight" component to this project, exactly as Nook ships it.

A card with a glow of the brand color that follows the pointer.

Steps
1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`.
2. Run `npx nook-ui@latest add spotlight`. It writes `components/ui/spotlight.tsx` together with everything the component needs. Do not write the component from memory.
3. If you cannot run commands, fetch http://localhost:3000/r/spotlight.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`.
4. Use it where I ask. Start from this example:

```tsx
import { Spotlight } from "@/components/ui/spotlight";

export default function SpotlightDefault() {
  return (
    <div className="grid w-full gap-4 sm:grid-cols-2">
      {[["Plans that stay true", "Move a task and every view updates."], ["Numbers people read", "Every chart has a table behind it."]].map(([title, text]) => (
        <Spotlight key={title}><h3 className="font-semibold">{title}</h3><p className="mt-1 text-sm text-muted-foreground">{text}</p></Spotlight>
      ))}
    </div>
  );
}
```

API
- `Spotlight`: The card.
  - `...props` (`React.HTMLAttributes<HTMLDivElement>`): Everything a div accepts.

Rules
- Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them.
- Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme.
- It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles.
- Accessibility: The glow is decoration. Touch and keyboard users, and people who prefer reduced motion, see the plain card.

Done when the component renders like the example in light and dark mode and the project type-checks.

Usage

import { Spotlight } from "@/components/ui/spotlight";

export default function SpotlightDefault() {
  return (
    <div className="grid w-full gap-4 sm:grid-cols-2">
      {[["Plans that stay true", "Move a task and every view updates."], ["Numbers people read", "Every chart has a table behind it."]].map(([title, text]) => (
        <Spotlight key={title}><h3 className="font-semibold">{title}</h3><p className="mt-1 text-sm text-muted-foreground">{text}</p></Spotlight>
      ))}
    </div>
  );
}

Examples

Pricing cards

Starter

$0

For trying things out

Team

$29

Per month, up to 10 people

Company

$99

Per month, unlimited people

Props

Spotlight

The card.

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>–Everything a div accepts.

Accessibility

The glow is decoration. Touch and keyboard users, and people who prefer reduced motion, see the plain card.

Checked against WCAG 2.1 AA with automated axe tests and keyboard tests on every release.