6 Replies
Hi @reina. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To adjust your UModal to a smaller size, you can use the
ui prop to customize its width. The UModal component in Nuxt UI has a default width of w-full sm:max-w-lg, but you can override this with your own custom width.
Here's how you can modify your code to make the modal smaller:
In this example, I've added the :ui="{ width: 'w-full sm:max-w-xs' }" prop to override the default width. You can adjust the value to any Tailwind width class that suits your needs:
- sm:max-w-xs (20rem / 320px)
- sm:max-w-sm (24rem / 384px)
- sm:max-w-md (28rem / 448px)
The w-full part ensures the modal takes full width on mobile devices, while the sm:max-w-* part controls the maximum width on larger screens.
According to the Modal component documentation, the default configuration includes width settings that you can customize through the ui prop.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@516186529547288576> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
bump
Nuxt UI
Modal Vue Component - Nuxt UI v3
A dialog window that can be used to display a message or request user input.
thanks!
The ":ui="{ width: 'w-full sm:max-w-xs' }"" the property width do not exists in v3.3, so how could we change the width of the modal using the ui prop?