{"id":15231949,"url":"https://github.com/clearlysid/tauri-plugin-decorum","last_synced_at":"2025-05-15T13:06:31.084Z","repository":{"id":237962643,"uuid":"795651664","full_name":"clearlysid/tauri-plugin-decorum","owner":"clearlysid","description":"Opinionated window decorations for Tauri apps","archived":false,"fork":false,"pushed_at":"2025-04-13T09:26:33.000Z","size":3665,"stargazers_count":224,"open_issues_count":10,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-15T03:51:52.826Z","etag":null,"topics":["macos","tauri","tauri-plugin","ui","windows"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/tauri-plugin-decorum","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clearlysid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["clearlysid"]}},"created_at":"2024-05-03T18:22:53.000Z","updated_at":"2025-04-13T09:26:37.000Z","dependencies_parsed_at":"2024-05-08T05:32:19.580Z","dependency_job_id":"20e5d6ba-d02e-4d9d-8c40-271df756b08c","html_url":"https://github.com/clearlysid/tauri-plugin-decorum","commit_stats":{"total_commits":116,"total_committers":9,"mean_commits":12.88888888888889,"dds":"0.24137931034482762","last_synced_commit":"278e34378116ea80f7b6176ae85cf6aa26c631eb"},"previous_names":["clearlysid/tauri-windows-titlebar","clearlysid/tauri-plugin-decorum"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlysid%2Ftauri-plugin-decorum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlysid%2Ftauri-plugin-decorum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlysid%2Ftauri-plugin-decorum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlysid%2Ftauri-plugin-decorum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clearlysid","download_url":"https://codeload.github.com/clearlysid/tauri-plugin-decorum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["macos","tauri","tauri-plugin","ui","windows"],"created_at":"2024-09-29T04:06:23.316Z","updated_at":"2025-05-15T13:06:26.065Z","avatar_url":"https://github.com/clearlysid.png","language":"Rust","readme":"# tauri-plugin-decorum\n\nBeing a designer, I'm _very_ particular about window decorations. This Tauri (v2) plugin is an opinionated take on titlebars that my gripes with the default ones. Features:\n1. retain native features, like Windows Snap Layout.\n2. blend into your app's UI better with transparency and overlay controls.\n3. inset macOS traffic lights that are often misaligned with other window contents.\n\n![demo](./wheeee.gif)\n\n## Installation and Usage\n\nFor a full example app that uses this plugin, check out [examples/tauri-app](examples/tauri-app/).\n\n### install the plugin\n\n```bash\ncargo add tauri-plugin-decorum\n```\n\n### set permissions\n\nYou'll need to set these for your window in `src-tauri/capabilities/default.json`\n\n```\n\"core:window:allow-close\",\n\"core:window:allow-center\",\n\"core:window:allow-minimize\",\n\"core:window:allow-maximize\",\n\"core:window:allow-set-size\",\n\"core:window:allow-set-focus\",\n\"core:window:allow-is-maximized\",\n\"core:window:allow-start-dragging\",\n\"core:window:allow-toggle-maximize\",\n\"decorum:allow-show-snap-overlay\",\n```\n\nAnd ensure the `withGlobalTauri` in your `tauri.conf.json` is set to `true`.\n\n\\*there's probably a better way to handle plugin permissions that I haven't found yet. if you have, pls lmk!\n\n\n### usage in tauri:\n\n```rust\nuse tauri::Manager;\n\nuse tauri_plugin_decorum::WebviewWindowExt; // adds helper methods to WebviewWindow\n\nfn main() {\n\ttauri::Builder::default()\n\t\t.plugin(tauri_plugin_decorum::init()) // initialize the decorum plugin\n\t\t.setup(|app| {\n\t\t\t// Create a custom titlebar for main window\n\t\t\t// On Windows this hides decoration and creates custom window controls\n\t\t\t// On macOS it needs hiddenTitle: true and titleBarStyle: overlay\n\t\t\tlet main_window = app.get_webview_window(\"main\").unwrap();\n\t\t\tmain_window.create_overlay_titlebar().unwrap();\n\n\t\t\t// Some macOS-specific helpers\n\t\t\t#[cfg(target_os = \"macos\")] {\n\t\t\t\t// Set a custom inset to the traffic lights\n\t\t\t\tmain_window.set_traffic_lights_inset(12.0, 16.0).unwrap();\n\n\t\t\t\t// Make window transparent without privateApi\n\t\t\t\tmain_window.make_transparent().unwrap()\n\n\t\t\t\t// Set window level\n\t\t\t\t// NSWindowLevel: https://developer.apple.com/documentation/appkit/nswindowlevel\n\t\t\t\tmain_window.set_window_level(25).unwrap()\n\t\t\t}\n\n\t\t\tOk(())\n\t\t})\n\t\t.run(tauri::generate_context!())\n\t\t.expect(\"error while running tauri application\");\n}\n```\n\n### custom buttons with css:\n\nIf you want to style the window controls yourself, you can use one of the following class-names to do so:\n\n```css\nbutton.decorum-tb-btn,\nbutton#decorum-tb-minimize,\nbutton#decorum-tb-maximize,\nbutton#decorum-tb-close,\ndiv[data-tauri-decorum-tb], {}\n```\n\n## Development Guide\n\nPRs and issues welcome! Here's a short primer to get you started with development on this:\n\n1. Ensure you have all the [Tauri prerequisites](https://beta.tauri.app/start/prerequisites/) set up\n2. Clone this repo\n3. Use the [example app](examples/tauri-app) as a test bed with `yarn tauri dev`\n\n## Roadmap\n\n~~There's some missing features I'd still like to add, all documented on the [Issues page](https://github.com/clearlysid/tauri-plugin-decorum/issues).~~\n\nAll the features I wanted are now added by me or a community member — thank you so much for your contributions! 🥳\n\nThe project mostly in maintainance mode now — no breaking API changes, other than architecture improvements and bugfixes. PRs are always welcome! I'll help merge them as quick as I can. In the long run I hope the core team incorporates all these within Tauri and I look forward to making this plugin obsolete.\n\nMeanwhile, I hope you find it useful. Happy building! 🥂\n","funding_links":["https://github.com/sponsors/clearlysid"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearlysid%2Ftauri-plugin-decorum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclearlysid%2Ftauri-plugin-decorum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearlysid%2Ftauri-plugin-decorum/lists"}