How to add a liquid glass chat input bar what framework give me example code how to do it
Asked on 06/11/2025
1 search
To add a Liquid Glass chat input bar, you can use the new design system introduced by Apple, which includes Liquid Glass as a key material. Depending on the framework you are using, the approach will vary slightly. Here are some examples based on the context provided:
AppKit
For an AppKit app, you can use the NSGlassEffectView
API to create Liquid Glass elements. Here's a basic example:
let glassEffectView = NSGlassEffectView()
glassEffectView.contentView = yourChatInputView
glassEffectView.cornerRadius = 10
glassEffectView.tintColor = .systemBlue
This code snippet creates a glass effect view and sets your chat input view as its content. You can customize the appearance using properties like cornerRadius
and tintColor
.
SwiftUI
In SwiftUI, you can use the glossEffect
modifier to apply a Liquid Glass effect to your custom views:
struct ChatInputView: View {
var body: some View {
TextField("Type a message...", text: $message)
.padding()
.background(Color.white)
.cornerRadius(10)
.glossEffect()
}
}
This example shows how to apply a gloss effect to a text field, which can be part of your chat input bar.
UIKit
For UIKit, you can create a UIVisualEffectView
with a custom glass effect:
let visualEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .systemMaterial))
visualEffectView.contentView.addSubview(yourChatInputView)
visualEffectView.layer.cornerRadius = 10
visualEffectView.clipsToBounds = true
This code snippet demonstrates how to create a visual effect view with a blur effect that mimics Liquid Glass, and then add your chat input view to it.
For more detailed guidance, you can refer to the session Build an AppKit app with the new design (17:43) or Build a SwiftUI app with the new design (17:29) for examples on adopting Liquid Glass in your app.

Build an AppKit app with the new design
Update your AppKit app to take full advantage of the new design system. We’ll dive into key changes to tab views, split views, bars, presentations, search, and controls, and show you how to use Liquid Glass in your custom UI. To get the most out of this video, we recommend first watching “Get to know the new design system” for general design guidance.

Build a SwiftUI app with the new design
Explore the ways Liquid Glass transforms the look and feel of your app. Discover how this stunning new material enhances toolbars, controls, and app structures across platforms, providing delightful interactions and seamlessly integrating your app with the system. Learn how to adopt new APIs that can help you make the most of Liquid Glass.

Build a UIKit app with the new design
Update your UIKit app to take full advantage of the new design system. We’ll dive into key changes to tab views, split views, bars, presentations, search, and controls, and show you how to use Liquid Glass in your custom UI. To get the most out of this video, we recommend first watching “Get to know the new design system” for general design guidance.