astro-grab

Visual element targeting for astro.

(Try the demo on desktop)

Installation

1. Install Package

npm install astro-grab

Or use bun add astro-grab with Bun.

2. Add Integration

// astro.config.mjs
import { defineConfig } from 'astro/config';
import { astroGrab } from 'astro-grab';

export default defineConfig({
  integrations: [
    astroGrab(),
  ],
});

/** Here are the options you can pass to `astroGrab()`
{
  enabled: true,        // Enable in dev mode
  holdDuration: 1000,   // Hold time in ms
  contextLines: 4,      // Lines around target
  hue: 30,              // Highlight color (orange)
  toolbar: true,        // Enable dev toolbar
}
*/

3. Start Dev Server

npm run dev

Toolbar appears in Astro dev mode.