Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
eonist committed Jan 21, 2025
1 parent 8066d07 commit c66e611
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,34 @@ struct ContentView: View {
- Add ways to inject size, style, accessID. Potentially as struct or typealias
- Remove Unit-test
- Add problem / solution to readme
- Allow users to customize the appearance of `TagBarView` more extensively by introducing a `TagBarStyle` configuration.

```swift:Sources/TagBarLib/TagBarStyle.swift
import SwiftUI

public struct TagBarStyle {
public var selectedBackgroundColor: Color
public var unselectedBackgroundColor: Color
public var selectedTextColor: Color
public var unselectedTextColor: Color
public var highlightCornerRadius: CGFloat

public static let defaultStyle = TagBarStyle(
selectedBackgroundColor: .accentColor,
unselectedBackgroundColor: .clear,
selectedTextColor: .white,
unselectedTextColor: .primary,
highlightCornerRadius: 8
)
}
public struct TagBarView: View {
// Existing properties...
public var style: TagBarStyle

public init(tagTypes: [TagTypeKind], selection: Binding<Int>, style: TagBarStyle = .defaultStyle) {
self.tagTypes = tagTypes
self._selection = selection
self.style = style
}
}
```

0 comments on commit c66e611

Please sign in to comment.