Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heyjaywilson/swiftui-buttons
https://github.com/heyjaywilson/swiftui-buttons
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/heyjaywilson/swiftui-buttons
- Owner: heyjaywilson
- Created: 2019-10-15T12:01:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T18:18:12.000Z (10 months ago)
- Last Synced: 2024-05-02T01:05:38.094Z (10 months ago)
- Language: Swift
- Size: 174 KB
- Stars: 8
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Button Styles
This is a table explaining the different button styles in SwiftUI and which platform each Button Style is available on.
| Button Style | iOS | watchOS | iPad OS | macOS |
| ------------ | --- | ------- | ------ | ------- |
| `PlainButtonStyle` | ✅ | ✅ | ✅ | ✅ |
| |  |  |  |  |
| `LinkButtonStyle`| ❌ | ❌ | ❌ | ✅ |
| | | | |  |
| `BorderedButtonStyle`| ❌ | ❌ | ❌ | ✅ |
| | | | |  |
| `BorderlessButtonStyle` | ✅ | ❌ | ✅ | ✅ |
| |  | |  |  |# How to use
Here is sample code of how to use a Button Style in SwiftUI.
```swift
Button(action: {
print("plain")
}) {
Text("Borderless button")
}.buttonStyle(BorderlessButtonStyle())```
In the [GitHub repo](https://github.com/heyjaywilson/swiftui-buttons), there is an Xcode project with each button style used.