Skip to content

feat: Add SolidJS adapter packages#12

Open
Peyton-Spencer wants to merge 4 commits intoTanStack:mainfrom
Peyton-Spencer:feat/solid-adapter
Open

feat: Add SolidJS adapter packages#12
Peyton-Spencer wants to merge 4 commits intoTanStack:mainfrom
Peyton-Spencer:feat/solid-adapter

Conversation

@Peyton-Spencer
Copy link

Summary

This PR adds two new packages to bring SolidJS support to TanStack Hotkeys:

📦 @tanstack/solid-hotkeys

Full-featured SolidJS adapter with reactive primitives:

  • createHotkey() - Register keyboard shortcuts with reactive options
  • createHotkeySequence() - Vim-style multi-key sequences (e.g., g g, d d)
  • createHeldKeys() / createKeyHold() - Track which keys are currently held
  • createHotkeyRecorder() - Built-in UI for letting users define their own shortcuts
  • HotkeysProvider - Global configuration context

🛠️ @tanstack/solid-hotkeys-devtools

Devtools stub for SolidJS (placeholder for future implementation). Currently provides no-op components until @tanstack/devtools-utils adds SolidJS support.

Features

Type-safe hotkey bindings - Template strings or parsed objects
Cross-platform - Mod key automatically maps to Cmd on macOS, Ctrl on Windows/Linux
Sequence support - Multi-key combos like Vim
Key state tracking - Know which keys are held down
Hotkey recording - Built-in UI helpers
SolidJS primitives - Reactive primitives that work seamlessly with SolidJS

Implementation Details

Both packages follow TanStack conventions:

  • Workspace dependencies using workspace:*
  • tsdown build configuration matching react-hotkeys
  • Full TypeScript support with JSX preservation for SolidJS
  • Matching package structure and naming conventions

The implementation is based on the existing React adapter but adapted for SolidJS's reactive primitive patterns (createEffect, createSignal, onCleanup, etc.).

Example Usage

```tsx
import { createHotkey } from "@tanstack/solid-hotkeys";

function App() {
createHotkey("Mod+S", (event) => {
event.preventDefault();
console.log("Save!");
});

return

Press Cmd/Ctrl+S to save
;
}
```

Testing

The packages build successfully and follow the same patterns as the existing React adapter. Unit tests can be added in a follow-up PR once the core functionality is reviewed.

Related

  • Similar to existing @tanstack/react-hotkeys adapter
  • Complements TanStack's growing SolidJS ecosystem

Note: The devtools package is a stub awaiting @tanstack/devtools-utils to add SolidJS support. Once that's available, we can implement the full devtools panel.

nanoclaw and others added 2 commits February 13, 2026 20:52
This PR adds two new packages for SolidJS support:

## @tanstack/solid-hotkeys
Full-featured SolidJS adapter for TanStack Hotkeys with reactive primitives:
- `createHotkey()` - Register keyboard shortcuts
- `createHotkeySequence()` - Vim-style multi-key sequences
- `createHeldKeys()` / `createKeyHold()` - Track key state
- `createHotkeyRecorder()` - Built-in hotkey recording UI
- `HotkeysProvider` - Global configuration context

Features:
✅ Type-safe hotkey bindings
✅ Cross-platform `Mod` key support
✅ Sequence support (e.g., `g g`, `d d`)
✅ Key state tracking
✅ Hotkey recording
✅ SolidJS reactive primitives

## @tanstack/solid-hotkeys-devtools
Devtools stub for SolidJS (placeholder for future implementation).
Currently provides no-op components until @tanstack/devtools-utils
adds SolidJS support.

Both packages follow TanStack conventions:
- Workspace dependencies
- tsdown build configuration
- Matching structure to react-hotkeys packages
- Full TypeScript support with JSX preservation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 15, 2026

Open in StackBlitz

@tanstack/hotkeys

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/hotkeys@12

@tanstack/hotkeys-devtools

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/hotkeys-devtools@12

@tanstack/react-hotkeys

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/react-hotkeys@12

@tanstack/react-hotkeys-devtools

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/react-hotkeys-devtools@12

@tanstack/solid-hotkeys

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/solid-hotkeys@12

@tanstack/solid-hotkeys-devtools

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/solid-hotkeys-devtools@12

commit: 59a5119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants