5 Replies
Hi @Just Simeon. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To increase the width of a modal in Nuxt UI, you have a few options:
Using the UI prop
You can customize the modal width by modifying the
ui
prop and targeting the content
slot. The default max width for a non-fullscreen modal is max-w-lg
, which you can override:
Using the Theme Configuration
For a global change to all modals, you can modify the theme configuration:
1. In your app.config.ts
file:
2. Or in your vite.config.ts
file:
Example for Specific Modal Types
For specific modal types like ContentSearch, you can target them directly:
ContentSearch Theme
The key is to modify the max-w-*
class to a larger size (like max-w-xl
, max-w-2xl
, max-w-3xl
, etc.) or use a custom width with w-[600px]
or similar.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@294593079812292609> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai now the title and description is hidden for some reason.
Let me check the knowledge base for you again. One moment! :books:
----------------------
If the title and description of your modal are hidden after increasing the width, this is likely due to a CSS issue with the customized UI prop overriding the default styling for the header section. Let me help you fix this.
Solution for Hidden Title and Description
When you customize the
content
slot in the UI prop, you need to make sure you're not removing essential classes that control the visibility of other elements. Here's how to fix it:
1. Make sure you're only modifying the width-related classes and preserving the rest of the default styling:
2. Alternatively, if you're using the #content
slot instead of the #body
slot, the title and description won't show because the header is part of the structured layout:
Important Note on Modal Structure
According to the Modal documentation, there are two ways to use the modal:
1. Using the #content
slot for complete customization (which doesn't include the built-in header)
2. Using the structured approach with title
, description
props and the #body
, #footer
slots
If you're using the first approach but want a title and description, you'll need to add them manually inside your content.
Check Your Implementation
Make sure you're not:
- Using the #content
slot while also expecting the title
and description
props to work
- Overriding the header styles in your UI customization
- Missing the required structure for the modal content
If you need more specific help, please share your current implementation code so I can provide more targeted assistance.
Modal Documentation
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@294593079812292609> Kapa.ai is still learning and improving, please let me know how I did by reacting below.