Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
agmmnn committed Jul 30, 2023
1 parent f9db13d commit a475d8f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ function MyTitlebar() {
}
```

![](https://github.com/agmmnn/tauri-controls/assets/16024979/7be3dde4-7953-4188-af12-abd4445c0bf9)

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.

```tsx
import { WindowTitlebar } from "tauri-controls"

Expand All @@ -70,23 +74,21 @@ function MyTitlebar() {
}
```

WindowTitlebar component handles the window controls and dynamically adjusts the control buttons and titlebar content order based on the current operating system.

[![](.github/statics/Frame.png)](https://www.figma.com/file/ms2vbZx5lEGxHqHR8fAfQm/Desktop-Native-Window-Controls?type=design&node-id=4%3A6020&mode=design&t=PIbVTsr8zWmIFsNr-1)
![](https://github.com/agmmnn/tauri-controls/assets/16024979/214677d4-dd70-4e6b-96c3-b9d1a1356f05)

> _If you get the message "Not allowed by scope" in the terminal after a production build (like me), try [this](https://github.com/agmmnn/tauri-controls/issues/1#issuecomment-1653557673)._
> _If you get the message "Not allowed by scope" in the terminal after a production build, try [this](https://github.com/agmmnn/tauri-controls/issues/1#issuecomment-1653557673)._
### Options

```ts
// WindowTitlebar:
controlsOrder?: "right" | "left" | "platform" | "system"
windowControlsProps?: WindowControlsProps

// WindowControls:
platform?: "windows" | "macos" | "gnome"
hide?: boolean
hideMethod?: "display" | "visibility"

// WindowTitlebar:
controlsOrder?: "right" | "left" | "platform"
windowControlsProps?: WindowControls
```

You can also pass additional `props` to elements like `data-tauri-drag-region` for further enhancements.
Expand All @@ -109,6 +111,8 @@ You can also pass additional `props` to elements like `data-tauri-drag-region` f

![](https://i.imgur.com/hq389kn.png)

[More examples](https://github.com/agmmnn/tauri-controls/blob/master/src/App.tsx).

# To-Do

If the library gets some interest, I can gradually add the following features:
Expand Down

0 comments on commit a475d8f

Please sign in to comment.