Create macOS panels for your Tauri app. Convert a regular window into a panel, or configure a new window with the panel builder.
Panels are a special type of window on macOS (NSPanel) that float above other windows and provide auxiliary controls or information. They're commonly used for tool palettes, inspectors, floating controls, and HUD displays.
[dependencies]
tauri-nspanel = "2.1"You can also install directly from the maintained v2.1 branch. This follows the latest commit on
the branch rather than a published crates.io release:
tauri-nspanel = { git = "https://github.com/ahkohd/tauri-nspanel", branch = "v2.1" }fn main() {
tauri::Builder::default()
.plugin(tauri_nspanel::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}use tauri::{Manager, WebviewUrl};
use tauri_nspanel::{tauri_panel, ManagerExt, PanelBuilder, PanelLevel};
// Define panel class
tauri_panel! {
panel!(MyPanel {
config: {
can_become_key_window: true,
is_floating_panel: true
}
})
}
// Create panel with builder
let panel = PanelBuilder::<_, MyPanel>::new(app.handle(), "my-panel")
.url(WebviewUrl::App("panel.html".into()))
.level(PanelLevel::Floating)
.build()?;
panel.show();use tauri::Manager;
use tauri_nspanel::ManagerExt;
#[tauri::command]
fn show_panel(app: tauri::AppHandle) {
if let Ok(panel) = app.get_webview_panel("my-panel") {
panel.show_and_make_key();
}
}
#[tauri::command]
fn close_panel(app_handle: tauri::AppHandle) {
app_handle
.get_webview_panel("my-panel")
.ok()
.and_then(|panel| panel.to_window())
.map(|window| window.close());
}See the documentation & API Reference.
- Create panels with PanelBuilder API or convert existing windows
- Mouse tracking with enter, exit, and move events
- Handle panel events
- Works with existing Tauri windows and commands
- Explicit main-thread handling for AppKit panel operations
Check out the examples directory.
Some projects using tauri-nspanel:
- Handy - Offline speech-to-text
- BongoCat - Cross-platform desktop pet
- Cap - Open-source screen recording
- screenpipe - Local screen recording and AI context
- Anarlog - Open-source AI meeting notes
- Vibe - Local transcription
- EcoPaste - Cross-platform clipboard manager
- Epicenter - Local-first applications
- Openless - AI-assisted voice input
- Coco - AI Search and Assistant
- Overlayed - Screen overlay
- Verve - Launcher
- JET Pilot - Kubernetes manager
- Buffer - AI-powered Markdown note app
- Asyar - Cross-platform alternative to Raycast
PRs accepted. Please read the Contributing Guide before making a pull request.