npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

tauri-plugin-spotlight-api

v0.1.2

Published

Tauri plugin that provides a MacOS Spotlight-like search functionality for Tauri windows.

Readme

Tauri Plugin: Spotlight

A Tauri plugin that provides a MacOS Spotlight-like search functionality for Tauri windows.

Overview

Spotlight is a Tauri plugin that provides a user-friendly and intuitive way to interact with your desktop applications - the Spotlight search-like interface.

This plugin is currently implemented for macOS, but has basic implementations for other platforms.

Features:

  1. Allows users to define hotkeys for showing and hiding the window
  2. Any window can register to implement the features provided by this plugin
  3. Window will automatically hide when losing focus
  4. Supports multiple displays (currently only available on macOS)
  5. Window will always appear on top and reactivate the previously active window upon hiding (currently only available on macOS)

Installation

Install the Core plugin by adding the following to your Cargo.toml file:

src-tauri/Cargo.toml

[dependencies]
tauri-plugin-spotlight = { git = "https://github.com/zzzze/tauri-plugin-spotlight" }

You can install the JavaScript Guest bindings using your preferred JavaScript package manager:

pnpm add tauri-plugin-spotlight-api
# or
npm add tauri-plugin-spotlight-api
# or
yarn add tauri-plugin-spotlight-api

Usage

Backend

There are three ways to configure the plugin:

  1. Register the spotlight plugin with Tauri:

src-tauri/src/main.rs

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_spotlight::init(Some(tauri_plugin_spotlight::PluginConfig {
            windows: Some(vec![
                tauri_plugin_spotlight::WindowConfig {
                    label: String::from("main"),
                    shortcut: String::from("Ctrl+Shift+J"),
                    macos_window_level: Some(20), // Default 24
                },
            ]),
            global_close_shortcut: Some(String::from("Escape")),
        })))
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
  1. Configure the plugin in your Tauri app's configuration file:

src-tauri/tauri.conf.json

{
  "plugins": {
    "spotlight": {
      "windows": [{
        "label": "main",
        "shortcut": "Ctrl+Shift+J",
        "macos_window_level": 20
      }],
      "global_close_shortcut": "Escape"
    }
  }
}

src-tauri/src/main.rs

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_spotlight::init(None))
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
  1. Manually register window shortcut keys

src-tauri/src/main.rs

use tauri_plugin_spotlight::ManagerExt;

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_spotlight::init(Some(tauri_plugin_spotlight::PluginConfig {
            windows: None,
            global_close_shortcut: Some(String::from("Escape")),
        })))
        .setup(|mut app| {
            if let Some(window) = app.get_window("main") {
                app.spotlight().init_spotlight_window(&window, "Ctrl+Shift+J").unwrap();
            }
            app_modifier::apply(&mut app);
            Ok(())
        })
        .build(tauri::generate_context!())
        .expect("error while running application");
}

The configuration parameters written in tauri.conf.json and tauri_plugin_spotlight::init will be automatically merged with tauri_plugin_spotlight::init taking higher priority.

Frontend

Use the hide function to make a spotlight window invisible:

import { hide } from 'tauri-plugin-spotlight-api';

void hide();

Example App

Prepare

  1. Build frontend API the plugin.
pnpm i
pnpm build
  1. Install dependencies of example app.
cd examples/react-app
pnpm i
  1. Start example app.
pnpm tauri dev

Thanks

This plugin was inspired by the tauri-macos-spotlight-example project by ahkohd, and borrows heavily from its codebase. Thanks to ahkohd and the contributors to tauri-macos-spotlight-example for their hard work and open-source contributions!