Overview
React Grab supports two activation modes that control how you enter and exit inspection mode:- Toggle mode (default) - Press once to activate, press again to deactivate
- Hold mode - Hold the key to activate, release to deactivate
Activation Modes
Toggle Mode
In toggle mode, a single keypress activates React Grab and it stays active until you press the key again.- Press ⌘C (Mac) or Ctrl+C (Windows/Linux) to activate
- Inspection mode stays active until you:
- Press the activation key again to deactivate
- Successfully copy an element (optional auto-deactivate)
- Press Escape
- Extended inspection sessions
- Comparing multiple elements
- Copying several elements in sequence
- Keyboard-driven navigation with arrow keys
Hold Mode
In hold mode, React Grab activates only while you hold down the activation key.- Press and hold the activation key for
keyHoldDurationmilliseconds - Inspection mode activates while key is held
- Release the key to immediately deactivate
- Quick one-off inspections
- Preventing accidental activation
- Muscle memory from DevTools (inspect-on-hover)
- Minimal interference with normal keyboard shortcuts
Keyboard Shortcuts
Default Activation Key
By default, React Grab uses the native copy shortcut:- Mac:
⌘C(Command+C) - Windows/Linux:
Ctrl+C
Copy Protection
When activated via the copy shortcut, React Grab prevents the default browser copy action:Context-Aware Activation
React Grab intelligently handles activation inside inputs:Additional Shortcuts
When React Grab is active:| Shortcut | Action |
|---|---|
| Escape | Deactivate and exit inspection mode |
| Arrow Keys | Navigate between parent/child/sibling elements |
| Enter | Copy the currently selected element |
| Right Click | Open context menu with actions |
Activation Key Customization
You can customize the activation key using theactivationKey option:
String Format
Custom Function
For complex key combinations:Examples
Single key:Parsing Activation Keys
Internally, React Grab parses activation keys:Hold Duration Configuration
ThekeyHoldDuration option controls how long you must hold the key before activation:
- 100ms (default) - Quick activation, minimal delay
- 200ms - More deliberate, prevents accidental activation
- 50ms - Very responsive, may activate unintentionally
Implementation Details
State Transitions
The activation state machine:Toolbar Control
The floating toolbar provides a visual toggle:activationMode:
Best Practices
When to use toggle mode
When to use toggle mode
Toggle mode is ideal when:
- You’re inspecting multiple elements in sequence
- You want to use arrow keys to navigate the component tree
- You’re comparing elements across different parts of the UI
- You want inspection mode to persist while you scroll or switch windows
When to use hold mode
When to use hold mode
Hold mode is ideal when:
- You want minimal interference with keyboard shortcuts
- You prefer inspect-on-demand behavior
- You’re making quick one-off inspections
- You want to prevent accidental activation
Customizing for your workflow
Customizing for your workflow
Combine activation mode with other options for optimal workflow:
