Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sentryco/searchbarkit
Sleek searchbar for iPad and macOS
https://github.com/sentryco/searchbarkit
Last synced: 1 day ago
JSON representation
Sleek searchbar for iPad and macOS
- Host: GitHub
- URL: https://github.com/sentryco/searchbarkit
- Owner: sentryco
- License: mit
- Created: 2024-10-31T07:25:32.000Z (17 days ago)
- Default Branch: main
- Last Pushed: 2024-11-12T23:14:21.000Z (4 days ago)
- Last Synced: 2024-11-13T00:19:47.392Z (4 days ago)
- Language: Swift
- Size: 58.6 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Tests](https://github.com/sentryco/SearchBarKit/actions/workflows/Tests.yml/badge.svg)](https://github.com/sentryco/SearchBarKit/actions/workflows/Tests.yml)
[![codebeat badge](https://codebeat.co/badges/80a82bb4-248f-44e1-9117-b780cddbc8e6)](https://codebeat.co/projects/github-com-sentryco-searchbarkit-main)# SearchBarKit
> Sleek searchbar for iOS and macOS
## Features
- Focus triggers callback and receeded look and feel
- Text change triggers callback
- Customizable sizing and color theme (via struct injection)
- Works for iOS and macOS
- Dark / light mode## Example
```swift
SearchBar(
placeholderText: "Search...", // Placeholder text
onFocus: { // Triggered when searchfield is focused
Swift.print("isFocused: \($0)")
}, onTextChange: { // Triggered when text changes
Swift.print("text: \($0)")
}
)
```## Installation
Add to your project using Swift Package Manager by adding the following URL:```swift
.package(url: "https://github.com/sentryco/SearchBarKit", branch: "main")
```## Dependencies:
- [HybridColor](https://github.com/sentryco/HybridColor)## Todo
- Maybe not hide close button on focus loss?
- Add more comments with AI
- Remove unit test, add uitest## Future improvments:
- Add SearchBarIdentifier (injectable accessid) (for now these are hardcoded)
- Move more metrics to const (later when it makes sense)