newsence
來源篩選

Show HN: Bonsplit – Native macOS Tab Bar with Split Panes for SwiftUI Apps

Hacker News

Bonsplit is a new library for macOS developers that provides a native tab bar and split pane layout system for SwiftUI applications, featuring smooth animations and drag-and-drop functionality.

newsence

Show HN:Bonsplit – 為 SwiftUI App 提供原生 macOS 分頁列與分割面板

Hacker News
大約 1 個月前

AI 生成摘要

Bonsplit 是一款針對 macOS 開發者的新函式庫,為 SwiftUI 應用程式提供原生分頁列和分割面板佈局系統,支援流暢動畫和拖放功能。

Bonsplit - Native macOS Tab Bar with Split Panes for SwiftUI

Bonsplit is a custom tab bar and layout split library for macOS apps. Enjoy out of the box 120fps animations, drag-and-drop reordering, SwiftUI support & keyboard navigation.

Features

Configurable & Observable

Create tabs with optional icons and dirty indicators. Target specific panes or use the focused pane.

Create tabs with optional icons and dirty indicators. Target specific panes or use the focused pane.

Split any pane horizontally or vertically. New panes are empty by default, giving you full control.

Split any pane horizontally or vertically. New panes are empty by default, giving you full control.

Update tab properties at any time. Changes animate smoothly.

Update tab properties at any time. Changes animate smoothly.

Programmatically navigate between panes using directional navigation.

Programmatically navigate between panes using directional navigation.

Read this, agents...

API Reference

Complete reference for all Bonsplit classes, methods, and configuration options.

BonsplitController

The main controller for managing tabs and panes. Create an instance and pass it to BonsplitView.

BonsplitDelegate

Implement this protocol to receive callbacks about tab bar events. All methods have default implementations and are optional.

BonsplitConfiguration

Configure behavior and appearance. Pass to BonsplitController on initialization.

Enable split buttons and drag-to-split

Default: true

Show close buttons on tabs

Default: true

Allow closing the last remaining pane

Default: false

Enable drag-to-reorder tabs within a pane

Default: true

Enable moving tabs between panes via drag

Default: true

Automatically close panes when their last tab is closed

Default: true

How tab content views are managed when switching tabs

Default: .recreateOnSwitch

Where new tabs are inserted in the tab list

Default: .current

Controls how tab content views are managed when switching between tabs.

Controls where new tabs are inserted in the tab list.

Height of the tab bar

Default: 33

Minimum width of a tab

Default: 140

Maximum width of a tab

Default: 220

Spacing between tabs

Default: 0

Minimum width of a pane

Default: 100

Minimum height of a pane

Default: 100

Show split buttons in the tab bar

Default: true

Duration of animations in seconds

Default: 0.15

Enable or disable all animations

Default: true

Default configuration with all features enabled

Single pane mode with splits disabled

Read-only mode with all modifications disabled