Skip to content

sentryco/SideBarKit

Repository files navigation

Tests codebeat badge

SideBarKit

Plug and play modular SideBar for macOS / iPad

img

Description

SideBarKit is a customizable Sidebar framework. Decouple the sidebar implementation. This results in cleaner, more manageable code.

Features:

  • Toggleable groups (hide / show)
  • Reactive tag labels (count change reactivly)
  • Dark / Light mode support
  • BYO (Bring your own) enum models
  • Works for iOS (iPad) and macOS

Example:

@State var selectedIdx: CombinedIndex? = .init(group: 0, item: 0) // Track selection
let model = [Top(), Middle(), Bottom()] // Define your model
MenuStack(selectedIndex: $selectedIdx, groups: model) // Add sidebar view

Installation:

To install SideBarKit using Swift Package Manager, add the following dependency to your Package.swift file:

.package(url: "https://github.com/sentryco/SideBarKit", branch: "main")

Dependencies:

Todo:

  • Add a way to customize metrics a bit. paddings, offsets etc to match original component
  • Consider removing binding from selection var. Bidning might not be needed
  • Remove unit-tests
  • Add UITests
  • Tag count may not need to be a binding
  • Tweak padding around groups. Looks too tall when collapsed

Future considerations:

  • Consider implementing toggle compact-mode / expanded-mode functionality etc, or not? at least wait and do it later when things are 👉 more stable 👈 etc (align icons to support compact mode)
  • Consider persisting collapsed state
  • Consider persisting selected index

About

Plug and play modular SideBar for macOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages