
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
tauri-controls
Advanced tools
Tauri Controls is a library that provides native-looking window controls for Tauri 2 applications. You can enhance the user experience of your Tauri 2 applications with window controls that mimic the identical native controls on the current system.
tauri-controls
uses Tauri's js/ts APIs to handle window events and just provides native-looking (designed according to official system design prototypes) html/react elements, not native, it does not rely on the system's native APIs.
The following designs are taken as reference:
pnpm add tauri-controls
#install peer dependencies
pnpm add @tauri-apps/plugin-os @tauri-apps/plugin-window
pnpm add -D clsx tailwind-merge
Then, make sure to include the following tauri plugins in your src-tauri
directory:
cargo add tauri-plugin-window tauri-plugin-os
Don't forget to register plugins in your main function.
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_window::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
And simply add the WindowControls
component to your code:
import { WindowControls } from "tauri-controls"
function MyTitlebar() {
return <WindowControls />
}
When no platform is specified, the current system will be detected and the matching element will be returned. It's a great solution for cross-platform releases.
WindowTitlebar component handles the window controls and dynamically adjusts the control buttons and titlebar content order based on the current operating system.
import { WindowTitlebar } from "tauri-controls"
function MyTitlebar() {
return (
<WindowTitlebar>{/* Place your titlebar content here */}</WindowTitlebar>
)
}
If you get the message "Not allowed by scope" in the terminal after a production build, try this.
// WindowTitlebar:
controlsOrder?: "right" | "left" | "platform" | "system"
windowControlsProps?: WindowControlsProps
// WindowControls:
platform?: "windows" | "macos" | "gnome"
hide?: boolean
hideMethod?: "display" | "visibility"
You can also pass additional props
to elements like data-tauri-drag-region
for further enhancements.
<WindowControls platform="macos" className="my-4" />
<WindowControls
platform="windows"
className="w-full justify-end"
data-tauri-drag-region
/>
If the library gets some interest, I can gradually add the following features:
Check out the design implementation on Figma for a visual reference. Desktop Native Window Controls - Figma.
These sources were utilized:
MIT
FAQs
🚥 Native-looking window controls for Tauri 2.
We found that tauri-controls demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.