Skip to content

Commit 9cfe836

Browse files
author
hadiuzzaman
committed
chore: update document
1 parent b6eb639 commit 9cfe836

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ You can change the background and text (foreground) colors of the active and ina
8383
- `spaceBetween`: Defines the space between each tab in the scroll view.
8484
- `leadingSpace` and `trailingSpace`: Set custom padding before the first tab and after the last tab, respectively.
8585

86+
### Complete Example
87+
8688
```swift
8789
import SwiftUI
8890
import ScrollableTabView
@@ -109,3 +111,36 @@ struct ContentView: View {
109111

110112

111113
```
114+
115+
## Parameters
116+
117+
| Parameter | Type | Default | Description |
118+
|------------------|------------|-----------------------|------------------------------------------------------------------|
119+
| `activeBgColor` | `Color` | `Color.accentColor` | The background color for the active tab. |
120+
| `inactiveBgColor`| `Color` | `Color.gray` | The background color for inactive tabs. |
121+
| `activeColor` | `Color` | `Color.primary` | The text/icon color for the active tab. |
122+
| `inActiveColor` | `Color` | `Color.secondary` | The text/icon color for inactive tabs. |
123+
| `cornerRadius` | `CGFloat` | `12` | The corner radius applied to the tabs. |
124+
| `spaceBetween` | `CGFloat` | `12` | The space between each tab in the scroll view. |
125+
| `leadingSpace` | `CGFloat` | `0` | The space before the first tab. |
126+
| `trailingSpace` | `CGFloat` | `0` | The space after the last tab. |
127+
| `items` | `[TabItem]`| **Required** | An array of `TabItem` objects representing each tab. |
128+
129+
## Predefined TabItem Components
130+
131+
`WithText`
132+
Displays text as the tab title.
133+
```swift
134+
WithText(text: "Tab Title", cornerRadius: 12)
135+
136+
```
137+
`WithTextAndIcon`
138+
Displays both text and an SF Symbol icon as the tab title.
139+
140+
```swift
141+
WithTextAndIcon(text: "Tab Title", systemName: "icon.name", cornerRadius: 12)
142+
143+
```
144+
145+
## License
146+
This package is available under the MIT license.

0 commit comments

Comments
 (0)