An open API service indexing awesome lists of open source software.

https://github.com/danielsaidi/buttonkit

ButtonKit is a SwiftUI library with button-specific utilities.
https://github.com/danielsaidi/buttonkit

ios macos swift swiftui tvos visionos watchos

Last synced: about 1 year ago
JSON representation

ButtonKit is a SwiftUI library with button-specific utilities.

Awesome Lists containing this project

README

          


Project Icon


Version
Swift 6.0
Documentation
MIT License

# ButtonKit

ButtonKit is a SwiftUI library with button-specific utilities.

## Installation

ButtonKit can be installed with the Swift Package Manager:

```
https://github.com/danielsaidi/ButtonKit.git
```

## Getting Started

For now, this library only contains a `StandardButtonType` with the following types:

```
add, addToFavorites,
cancel, call, close, copy,
delete, deselect, done,
edit, email, export,
like,
ok,
paste,
removeFromFavorites, removeLike,
save, search, select, share
```

A standard button type defines the following information:

* Title
* Icon
* Button Role
* Keyboard Shortcut

You can use the custom `Button(:action:)` initializer to create a standard button with all those properties applied, for instance:

```swift
Button(.add)Β {
// Add your custom add logic here
}
```

The button above will render properly on all major Apple platforms, and use proper localization. You can apply any view modifiers and button styles to the button to customize it.

## Localization

ButtonKit is localized in the following languages:

* πŸ‡ΊπŸ‡Έ English (US)
* πŸ‡ΈπŸ‡ͺ Swedish

Use `Sources/ButtonKit/Resources/Localizable.xcstrings` to add support for more languages.

## Documentation

The online [documentation][Documentation] has more information, articles, code examples, etc.

## Demo Application

This repository will get a demo app after it reaches 100 stars.

## Support my work

You can [sponsor me][Sponsors] on GitHub Sponsors or [reach out][Email] for paid support, to help support my [open-source projects][OpenSource].

Your support makes it possible for me to put more work into these projects and make them the best they can be.

## Contact

Feel free to reach out if you have questions, or want to contribute in any way:

* Website: [danielsaidi.com][Website]
* E-mail: [daniel.saidi@gmail.com][Email]
* Bluesky: [@danielsaidi@bsky.social][Bluesky]
* Mastodon: [@danielsaidi@mastodon.social][Mastodon]

## License

ButtonKit is available under the MIT license. See the [LICENSE][License] file for more info.

[Email]: mailto:daniel.saidi@gmail.com
[Website]: https://danielsaidi.com
[GitHub]: https://github.com/danielsaidi
[OpenSource]: https://danielsaidi.com/opensource
[Sponsors]: https://github.com/sponsors/danielsaidi

[Bluesky]: https://bsky.app/profile/danielsaidi.bsky.social
[Mastodon]: https://mastodon.social/@danielsaidi
[Twitter]: https://twitter.com/danielsaidi

[Documentation]: https://danielsaidi.github.io/ButtonKit
[Getting-Started]: https://danielsaidi.github.io/ButtonKit/documentation/ButtonKit/getting-started
[License]: https://github.com/danielsaidi/ButtonKit/blob/master/LICENSE