Swiftpack.co - KeyboardKit/KeyboardKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by KeyboardKit.
KeyboardKit/KeyboardKit 6.4.0
KeyboardKit is a Swift library that helps you build custom keyboard extensions.
⭐️ 832
🕓 1 hour ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/KeyboardKit/KeyboardKit.git", from: "6.4.0")

KeyboardKit Logo

Version Swift 5.6 MIT License Twitter: @getkeyboardkit

About KeyboardKit

KeyboardKit is a Swift library that helps you build custom keyboards with Swift and SwiftUI. It extends the native keyboard APIs and provides you with a lot more functionality than is otherwise available.

KeyboardKit lets you create keyboards that mimic the iOS stock keyboard in a single line of code. These keyboards can be customized to great extent to change their input keys, keyboard layout, design, behavior etc.

You can also use entirely custom views with the rich features of KeyboardKit, to create completely custom keyboard extensions. Most of the KeyboardKit features can be used on all major Apple platforms as well.

Supported Platforms

KeyboardKit supports iOS 13, macOS 11, tvOS 13 and watchOS 6.

Although KeyboardKit builds on all platform, some features are unavailable on some platforms.


KeyboardKit can be installed with the Swift Package Manager:


or with CocoaPods:

pod KeyboardKit

You can add the library to the main app, the keyboard extension and any other targets that need it.


The online documentation has a getting-started guide, as well as articles, code examples etc. that let you overview the various parts of the library and understand how they all connect to each other.

The online documentation is currently iOS-specific. To generate documentation for other platforms, open the package in Xcode, select a simulator then run Product/Build Documentation.

Note that extensions to native types are not included in this documentation. Future versions of this library will refactor the extensions in a way that makes them appear in the documentation.

✨ Features

KeyboardKit is localized in 50+ keyboard-specific locales (read more):

🇺🇸 🇦🇱 🇦🇪 🇧🇾 🇧🇬 🇦🇩 🇭🇷 🇨🇿 🇩🇰 🇳🇱
🇧🇪 🇬🇧 🇺🇸 🇪🇪 🇫🇴 🇵🇭 🇫🇮 🇫🇷 🇨🇭 🇬🇪
🇩🇪 🇦🇹 🇬🇷 🇭🇺 🇮🇸 🇮🇪 🇮🇹 🇹🇯 🇱🇻 🇱🇹
🇲🇰 🇲🇹 🇲🇳 🇳🇴 🇮🇷 🇵🇱 🇵🇹 🇧🇷 🇷🇴 🇷🇺
🇷🇸 🇸🇰 🇸🇮 🇪🇸 🇰🇪 🇸🇪 🇹🇷 🇺🇦 🇺🇸 🇧🇪

KeyboardKit also comes packed with a bunch of features to help you build amazing and powerful keyboards:

  • 💥 Actions - KeyboardKit comes with keyboard actions like characters, emojis, actions, custom ones etc.
  • 🎨 Appearance - KeyboardKit comes with an appearance engine that lets you easily style your keyboards.
  • 💡 Autocomplete - KeyboardKit can present autocomplete suggestions as the user types.
  • 🗯 Callouts - KeyboardKit can show input callouts, as well as long press callouts with secondary actions.
  • 😊 Emojis - KeyboardKit defines emojis and emoji categories that you can use in your own keyboards.
  • 🧩 Extensions - KeyboardKit provides a bunch of extensions to native types.
  • ⌨️ External Keyboards - KeyboardKit lets you detect whether or not an external keyboard is used.
  • 👋 Feedback - KeyboardKit keyboards can give users audio and haptic feedback feedback as they type.
  • 👆 Gestures - KeyboardKit comes with keyboard-specific gestures that you can use in your own keyboards.
  • 🔤 Input Sets - KeyboardKit supports creating alphabetic, numeric and symbolic and custom input sets.
  • ⌨️ Keyboard Layouts - KeyboardKit supports creating keyboard layouts for various devices, locales etc.
  • 💱 Keyboard Types - KeyboardKit supports keyboard types, like alphabetic, numeric, symbolic etc.
  • 🌐 Locales- KeyboardKit defines keyboard-specific locales with localized content and assets.
  • 👁 Previews - KeyboardKit defines a bunch of tools that simplify previewing keyboard views in SwiftUI.
  • ➡️ Proxy - KeyboardKit defines a bunch of extensions to UITextDocumentProxy and ways to proxy text.
  • ⬅️ RTL - KeyboardKit supports RTL (right-to-left) locales, such as Arabic, Persian, Kurdish etc.
  • 🎨 Styles - KeyboardKit defines a bunch of styles that simplify customizing the look of various components.
  • 🖼 Views - KeyboardKit comes with a bunch of keyboard-specific views, like keyboards, toobars, buttons etc.

KeyboardKit Pro

KeyboardKit Pro extends KeyboardKit with pro features, such as additional locales, autocomplete engines, convenience views etc. It lets you create fully localized system keyboards with a single line of code.

KeyboardKit Pro can save you a lot of time when developing more complex keyboards.

Read more here

Demo Applications

This repository contains a Demo folder with two demo apps that lets you try out KeyboardKit.

The Demo app uses KeyboardKit and lets you type in a light and dark text field. It has three keyboards:

  • English uses a SystemKeyboard to mimic a native English keyboard.
  • Unicode uses a SystemKeyboard and a custom, unicode-based input set.
  • Custom shows you how to easily customize input sets and layouts.

The Demo - Pro app uses KeyboardKit Pro and supports 50+ locales, autocomplete etc. It has two keyboards:

  • System LTR uses a SystemKeyboard with all left-to-right locales.
  • System RTL uses a SystemKeyboard with all right-to-left locales.

Just open and run any of these projects, then enable the keyboards you want to try under System Settings. Note that you need to enable full access to try some features, like audio and haptic feedback.


KeyboardKit is open-source and completely free, but you can sponsor this project on GitHub Sponsors, upgrade to KeyboardKit Pro or get in touch for paid support.

KeyboardKit is proudly sponsored by the following companies:

Oribi Icon phonetoroam Icon Vitalis Icon LetterKey Icon Anomaly Software Icon Milo Creative Icon


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


KeyboardKit is available under the MIT license. See the LICENSE file for more info.


Stars: 832
Last commit: 1 hour ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

3 hours ago

This release bumps the package Swift version to 5.6.

The release makes more types, extensions, mocks and unit tests available for macOS, tvOS and watchOS. It also binds a bunch of extensions to protocols, which make them show up in DocC and makes it possible to use them on more types.

There are also new layout utilities that make adjusting keyboard locales a lot easier, and a bunch of struct properties have been converted from let to var to make them mutable.

The demos have been adjusted as well, and there is a brand new demo keyboard that shows how to customize the layout.

👑 KeyboardKit Pro changes

  • KurdishSoraniPcInputSetProvider is a new input set provider for Kurdish Sorani PC.
  • KurdishSoraniPcCalloutActionProvider is a new callout action provider for Kurdish Sorani PC.
  • AlphabeticInputSet has new kurdishSoraniPc input set builder.

🌐 New locales

  • 🇹🇯 Kurdish Sorani PC

✨ New features

  • CaseAdjustable is a new protocol that can be implemented by types that should be able to adjust themselves to a casing.
  • EmojiKeyboardStyle now lets you provide a device type in the standard style builder.
  • HapticFeedback now uses HapticFeedbackPlayer for its player.
  • InputCallout now lets you provide a device type in the initializer.
  • InputSet properties are now mutable.
  • InputSetItem properties are now mutable.
  • KeyboardColorReader is a new protocol that is implemented by Color and lets its implementations access keyboard colors.
  • KeyboardContext has a new keyboardType property.
  • KeyboardContext no longer requires a controller in the initializer, although it's good to provide one.
  • KeyboardFeedbackHandler is now available on all platforms.
  • KeyboardImageReader is a new protocol that is implemented by Image and lets its implementations access keyboard images.
  • KeyboardLayout has new ideal height and inset properties, which can be used to create new item types easier.
  • KeyboardLayoutConfiguration properties are now mutable.
  • KeyboardLayoutConfiguration has a new standard layout for device type.
  • KeyboardLayoutItem properties are now mutable.
  • KeyboardLayoutItemSize properties are now mutable.
  • KeyboardRowItem has a bunch of new collection extensions.
  • StandardAutocompleteSuggestion properties are now mutable.
  • StandardKeyboardFeedbackHandler is now available on all platforms.
  • SystemAudio now uses SystemAudioPlayer for its player.

💡 Behavior changes

  • Color extensions have been moved to KeyboardColorReader.
  • KeyboardContext activeAppBundleId has been converted to a calculated property.
  • StandardKeyboardLayoutProvider now fallbacks to iPhone layout instead of an empty layout.
  • StandardKeyboardLayoutProviderTests now runs on all platforms.
  • String casing extensions have been moved to CaseAdjustable.

🐛 Bug fixes

  • A memory leak has been fixed.

🗑 Deprecations

  • The Color.DarkAppearanceStrategy is no longer used and has been deprecated.
  • The KeyboardContext device initializer and property has been deprecated.
  • The KeyboardContext activeAppBundleId no longer works in iOS 16 and has been deprecated.
  • The KeyboardLayoutConfiguration standard configuration for idiom has been deprecated.
  • The KeyboardInputViewController activeAppBundleId no longer works in iOS 16 and has been deprecated.
  • The MockCollectionViewLayout is no longer used and has been deprecated.
  • Two Sequence extensions for mapping casing are no longer used and have been deprecated.
  • The StandardKeyboardLayoutProvider fallbackProvider has been deprecated.
  • The StandardKeyboardLayoutProvider layoutProvider(for:) has been renamed to keyboardLayoutProvider(for:).

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics