QuickSearch

0.4.0

QuickSearch is a SwiftUI SDK that lets you type into a searchable text field without first having to focus on it.
danielsaidi/QuickSearch

What's New

2025-04-01T14:00:42Z

This version makes QuickSearch compile for all platforms.

Project Icon

Version Swift 6.0 Swift UI Documentation MIT License

QuickSearch

QuickSearch is a SwiftUI SDK that lets you type into a .searchable text field by just typing, without first having to focus on the text field. It's good for content-based views without any other text fields.

QuickSearch works on all Macs and iPads with a physical keyboard. The .searchable text field can be used like a regular text field on devices with no physical keyboard.

Unlike the native .searchable(text: $query, isPresented: .constant(true)) modifier, QuickSearch doesn't show the input cursor, to avoid draving attention to the search field.

Installation

QuickSearch can be installed with the Swift Package Manager:

https://github.com/danielsaidi/QuickSearch.git

Getting Started

All you have to do to make QuickSearch work, is to apply quickSearch: true to .searchable:

 struct ContentView: View {
 
     @State var query = ""
     @State var text = ""
 
     @FocusState var isTextFieldFocused
    
     var body: some View {
         NavigationStack {
             VStack {
                TextField("Type here...", text: $text)
             }
             .searchable(text: $query, quickSearch: true)
         }
     }
}

You can also apply the .quickSearch view modifier, to any superview, if you can't access .searchable, use custom focus bindings, etc.

Documentation

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

Demo Application

The Demo folder has an app that lets you try the library on macOS and on iPads with a hardware keyboard.

Support my work

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

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:

License

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

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Tue May 13 2025 01:02:22 GMT-0900 (Hawaii-Aleutian Daylight Time)