Overview
Avante.nvim supports multiple input providers for user input dialogs (like API key entry). You can choose between the native vim input, enhanced UI libraries, or create your own custom provider.Available Providers
Native (Default)
Uses vim’s built-invim.ui.input for input dialogs.
- No additional dependencies
- Simple and lightweight
- Always available
- Basic UI
- Limited customization
Dressing.nvim
stevearc/dressing.nvim provides enhanced input UI with better styling and features. Pros:- Better visual styling
- More customization options
- Works with other plugins using
vim.ui
Snacks.nvim (Recommended)
folke/snacks.nvim provides a modern, feature-rich input UI. Pros:- Modern, polished UI
- Rich customization
- Consistent with other snacks.nvim features
- Great visual feedback
Custom Input Provider
Create a completely custom input provider by providing a function:Custom Provider Example
Input Provider Parameters
When creating a custom provider, you receive aninput object with:
The title/prompt for the input dialogExample:
"Enter API Key"Default value to pre-fill in the inputExample:
"sk-..."Whether to conceal the input (for passwords/API keys)When
true, display asterisks instead of actual charactersCallback function to call with the resultSignature:
fun(result: string|nil): nil- Pass the user’s input as a string
- Pass
nilif cancelled
Provider Comparison
| Feature | Native | Dressing | Snacks | Custom |
|---|---|---|---|---|
| Dependencies | None | dressing.nvim | snacks.nvim | None |
| Visual Quality | Basic | Good | Excellent | Depends |
| Customization | Limited | Good | Excellent | Full |
| Complexity | Simple | Medium | Medium | High |
| Recommended | Basic use | General | Best UX | Specific needs |
When to Use Each Provider
Native
Native
Use when:
- You want minimal dependencies
- You prefer simplicity over aesthetics
- You’re running Neovim in limited environments
Dressing
Dressing
Use when:
- You already use dressing.nvim
- You want consistent
vim.uibehavior - You need good customization without complexity
Snacks (Recommended)
Snacks (Recommended)
Use when:
- You want the best visual experience
- You use other snacks.nvim features
- You appreciate modern UI design
Custom
Custom
Use when:
- You have very specific requirements
- You want complete control over behavior
- You’re integrating with other custom UI
Example Use Cases
API Key Entry with Snacks
Simple Input with Dressing
Custom Input with Validation
Troubleshooting
Input not appearing
Input not appearing
- Verify the provider is installed (dressing/snacks)
- Check provider configuration is correct
- Look for errors in
:messages - Try switching to
"native"to test
Custom provider not working
Custom provider not working
- Ensure you’re calling
on_submitwith a result - Verify the function signature matches expectations
- Check for errors in your custom logic
- Test with a simple implementation first
Styling issues
Styling issues
- Check
provider_optsare correct for your provider - Verify colorscheme compatibility
- Review provider’s documentation for options
- Try default options first, then customize
Best Practices
Start Simple
Begin with native or dressing, then move to snacks or custom if needed.
Consistent Experience
Use the same provider across your config for consistency.
Handle Cancellation
Always handle the case where users cancel input (nil result).
Visual Feedback
Use appropriate icons and titles to help users understand what’s being requested.
Related Documentation
Configuration
General Avante configuration
Providers
Configure AI providers and API keys