{"id":13479498,"url":"https://github.com/CleanCocoa/FatSidebar","last_synced_at":"2025-03-27T09:32:49.816Z","repository":{"id":87401420,"uuid":"86793870","full_name":"CleanCocoa/FatSidebar","owner":"CleanCocoa","description":"Custom vertical button toolbar for macOS","archived":false,"fork":false,"pushed_at":"2023-12-28T18:00:11.000Z","size":359,"stargazers_count":74,"open_issues_count":5,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-01T16:56:08.578Z","etag":null,"topics":["component","macos","sidebar","swift","toolbar","view"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/CleanCocoa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2017-03-31T08:02:09.000Z","updated_at":"2023-12-01T20:41:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"a2be6fba-d1b9-4131-827c-ed438c666831","html_url":"https://github.com/CleanCocoa/FatSidebar","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FFatSidebar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FFatSidebar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FFatSidebar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FFatSidebar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleanCocoa","download_url":"https://codeload.github.com/CleanCocoa/FatSidebar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222230567,"owners_count":16952662,"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":["component","macos","sidebar","swift","toolbar","view"],"created_at":"2024-07-31T16:02:17.665Z","updated_at":"2024-10-30T13:30:43.819Z","avatar_url":"https://github.com/CleanCocoa.png","language":"Swift","readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"assets/title.png\" width=\"300\"/\u003e\n\u003c/div\u003e\n\n# FatSidebar\n\n![Swift 5.0](https://img.shields.io/badge/Swift-5.0-blue.svg?style=flat)\n![Version](https://img.shields.io/github/tag/CleanCocoa/FatSidebar.svg?style=flat)\n![License](https://img.shields.io/github/license/CleanCocoa/FatSidebar.svg?style=flat)\n![Platform](https://img.shields.io/badge/platform-macOS-lightgrey.svg?style=flat)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nCustom vertical button toolbar for macOS.\n\n## Item Styles\n\nThe component supports 2 different styles: `.regular` and `.small`.\n\nAt the moment, `FatSidebar` [does not support responsive switching between styles](https://github.com/CleanCocoa/FatSidebar/issues/1). If you decide to display the sidebar at 50pt width or more, the `.regular` style is a good match.\n\n### Regular Style\n\nThe `.regular` style displays the button label right below the icon:\n\n![](assets/style-regular.png)\n\n### Small Style\n\nThe `.small` style doesn't show the label by default. But when you hover over an item, it expands horizontally to show the label.\n\n![](assets/style-small.png)\n\nThis is a good choice for super-long labels that don't fit the regular style.\n\nIf you configure the sidebar to be fairly wide, it still works as expected -- but obviously is a lot more spacious.\n\n![](assets/style-small_wide.png)\n\n\n## Theming\n\nThe component's colors can be changed by creating a custom `FatSidebarTheme` implementation:\n\n```swift\npublic protocol FatSidebarTheme {\n    var itemStyle: FatSidebarItemStyle { get }\n    var sidebarBackground: NSColor { get }\n}\n\npublic protocol FatSidebarItemStyle {\n    var background: StatefulColor { get }\n    var borders: Borders { get }\n}\n```\n\n`StatefulColor` boils down to a struct with three `NSColor` values for the three states a `FatSidebarItem` can be in: `normal`, `selected`, and `highlighted`. It comes with a convenience initializer in case you don't like when things change in your life: `StatefulColor.init(single:)`\n\n`Borders` is a struct with 4 optional `StatefulColor` objects, one for each side of the item.\n\n### Example Theme\n\nAs a hat-tip to the OmniGroup's good-looking sidebar from OmniFocus, here's a theme that's close to OmniFocus's colors:\n\n```swift\nstruct OmniFocusTheme: FatSidebarTheme {\n\n    let itemStyle: FatSidebarItemStyle = OmniFocusItemStyle()\n    let sidebarBackground = OmniFocusTheme.backgroundColor\n\n    static var selectedColor: NSColor { return #colorLiteral(red: 0.901724875, green: 0.9334430099, blue: 0.9331719875, alpha: 1) }\n    static var recessedColor: NSColor { return #colorLiteral(red: 0.682291925, green: 0.6823920608, blue: 0.68227005, alpha: 1) }\n    static var backgroundColor: NSColor { return #colorLiteral(red: 0.7919496894, green: 0.8197044134, blue: 0.8194655776, alpha: 1) }\n\n    struct OmniFocusItemStyle: FatSidebarItemStyle {\n\n        let background = StatefulColor(\n            normal:      OmniFocusTheme.backgroundColor,\n            selected:    OmniFocusTheme.selectedColor,\n            highlighted: OmniFocusTheme.recessedColor)\n\n        let borders = Borders(\n            bottom: StatefulColor(single: OmniFocusTheme.recessedColor),\n            right: StatefulColor(\n                normal:      OmniFocusTheme.recessedColor,\n                selected:    OmniFocusTheme.selectedColor,\n                highlighted: OmniFocusTheme.recessedColor))\n    }\n}\n```\n\n## Code License\n\nCopyright (c) 2019 Christian Tietze. Distributed under the MIT License.\n\n## Icon License\n\nIconic v1.9.0 License. To view Iconic's license, please go to \u003chttps://useiconic.com/license/\u003e.\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCleanCocoa%2FFatSidebar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCleanCocoa%2FFatSidebar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCleanCocoa%2FFatSidebar/lists"}