N
Nuxt3mo ago
WiFi Plug

upagemarquee doesn't respect width of parent div?

I have a div with "px-4 mx-auto max-w-[var(--ui-container)] flex flex-col gap-8 items-center py-16 relative" and inside that div i put a upagemarquee " <UPageMarquee> <UIcon name="i-simple-icons-github" class="size-10 shrink-0" /> <UIcon name="i-simple-icons-discord" class="size-10 shrink-0" /> <UIcon name="i-simple-icons-x" class="size-10 shrink-0" /> <UIcon name="i-simple-icons-instagram" class="size-10 shrink-0" /> <UIcon name="i-simple-icons-linkedin" class="size-10 shrink-0" /> <UIcon name="i-simple-icons-facebook" class="size-10 shrink-0" /> </UPageMarquee>' but the marquee extends past its parent div to a div above its width. why is that how do i make it the width of the parent
17 Replies
kapa.ai
kapa.ai3mo ago
Hi @WiFi Plug. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The behavior you're seeing is due to the default styling of the UPageMarquee component. By default, the marquee's root and content use flex layouts and set their widths to allow for smooth infinite scrolling, which can cause the marquee to extend beyond the width of its parent container. From the theme configuration, the root of UPageMarquee uses:
root: 'group relative flex items-center overflow-hidden gap-(--gap) [--gap:--spacing(16)] [--duration:20s]',
content: 'flex items-center shrink-0 justify-around gap-(--gap) min-w-max'
root: 'group relative flex items-center overflow-hidden gap-(--gap) [--gap:--spacing(16)] [--duration:20s]',
content: 'flex items-center shrink-0 justify-around gap-(--gap) min-w-max'
The key part is min-w-max on the content, which makes the content as wide as its children, not constrained by the parent. This is intentional for the marquee effect, but it means the marquee can overflow its parent if not handled. How to constrain the width: - Make sure the parent div has a defined width (which you already do with max-w-[var(--ui-container)]). - To ensure the marquee respects the parent width, you can override the default ui prop for the UPageMarquee and set the root/content classes to remove min-w-max and set w-full instead. Example:
<UPageMarquee :ui="{ root: 'w-full', content: 'w-full' }">
<UIcon name="i-simple-icons-github" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-discord" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-x" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-instagram" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-linkedin" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-facebook" class="size-10 shrink-0" />
</UPageMarquee>
<UPageMarquee :ui="{ root: 'w-full', content: 'w-full' }">
<UIcon name="i-simple-icons-github" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-discord" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-x" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-instagram" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-linkedin" class="size-10 shrink-0" />
<UIcon name="i-simple-icons-facebook" class="size-10 shrink-0" />
</UPageMarquee>
You may need to further adjust the content class if you want to keep the marquee effect but ensure it doesn't overflow. Removing min-w-max and using w-full will make the marquee content fit the parent width. For more details, see the PageMarquee theme configuration and usage examples. If you want to keep the marquee effect but need more control, you can also use the ui prop to fine-tune the classes as needed for your layout. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@679734274840330384> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
WiFi Plug
WiFi PlugOP3mo ago
@kapa.ai how can i debug high memory usage / increasing memory usage? I see in chrome that my tabs memory usage is 1.1GB which seems really high, it starts off lower at about 560MB then keeps growing slowly?
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- To debug high or increasing memory usage in a Nuxt app, here are some steps and tips based on the knowledge sources: 1. Check for Memory Leaks in Your Code - Common causes include unclosed intervals/timeouts, lingering event listeners, or excessive reactivity (e.g., unnecessary watchers or computed properties) [YouTube: Overusing Reactivity in Vue?]. - In SSR, be careful with global state or objects that persist across requests. 2. Use Browser and Node.js Debugging Tools - Use Chrome DevTools' Performance and Memory tabs to take heap snapshots and track memory growth over time. - For server-side debugging, you can start Nuxt with the Node inspector:
nuxt dev --inspect

nuxt dev --inspect

Then attach Chrome DevTools to the Node process to analyze memory usage [Nuxt Debugging Guide]. 3. Enable Sourcemaps for Easier Debugging - Sourcemaps help you trace memory issues back to your source code:
export default defineNuxtConfig({
sourcemap: {
server: true,
client: true
}
})

export default defineNuxtConfig({
sourcemap: {
server: true,
client: true
}
})

[Nuxt Debugging Guide] 4. Profile and Minimize Reproduction - Try to reproduce the issue in a minimal environment. Remove as much code as possible while still triggering the memory growth. This helps isolate the cause [Reporting Bugs]. 5. Check for Known Issues - Some Nuxt versions or modules have had memory leak issues (e.g., with payload caching, certain modules, or SSR state management). Make sure you are on the latest Nuxt version, as some leaks have been fixed in recent releases [Github Issue: named exports of components are incorrectly exposed]. - If using third-party modules (like @nuxtjs/svg-sprite), check their issue trackers for memory leak reports [Github Issue: Memory Leak & Bundle Hash Issues]. 6. Be Careful with Console Logging - Logging large objects in Node.js with the inspector attached can prevent them from being garbage collected, leading to apparent leaks during debugging [Github Issue: useState + SSR = memory leak]. 7. If You Suspect a Nuxt Bug - Search existing issues and, if needed, create a minimal reproduction and report it to the Nuxt team [Reporting Bugs]. If you continue to see memory growth, try to identify which components or pages trigger the increase, and use the above tools to narrow down the cause. If the issue is in a third-party module or Nuxt itself, updating or reporting it with a minimal reproduction will help get it resolved. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@679734274840330384> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
WiFi Plug
WiFi PlugOP3mo ago
@kapa.ai " <UButton color="info" variant="ghost" size="lg" block class="p-0" > <UAlert color="info" variant="subtle" title="djffdghj" description="fghjfghjgfhj icon="i-lucide-target" /> </UButton>" i put a ualert in a ubutton but the flex justify centre or items-center is causing the items in ualert to be centered but i want then aligned normally flex start
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- To control the alignment of the content inside a UButton when you nest a UAlert inside it, you should use the class or ui prop to override the default flex alignment styles. By default, UButton uses flex and centers its content. This causes the UAlert (and its children) to be centered. To align the content to the start (left), you can override the alignment using the class prop on UButton:
<UButton
color="info"
variant="ghost"
size="lg"
block
class="p-0 justify-start items-start"
>
<UAlert
color="info"
variant="subtle"
title="djffdghj"
description="fghjfghjgfhj"
icon="i-lucide-target"
/>
</UButton>
<UButton
color="info"
variant="ghost"
size="lg"
block
class="p-0 justify-start items-start"
>
<UAlert
color="info"
variant="subtle"
title="djffdghj"
description="fghjfghjgfhj"
icon="i-lucide-target"
/>
</UButton>
- justify-start aligns items to the start horizontally. - items-start aligns items to the start vertically. If you need more granular control, you can also use the ui prop to override specific slot styles for either UButton or UAlert as shown in the Button and Alert documentation. If you still see centering, check if UAlert itself has alignment styles you need to override using its class or ui prop.
The knowledge sources confirm you can override alignment using the class or ui prop for both UButton and UAlert components, but do not provide a direct example for this exact nesting scenario. The approach above is based on the documented usage of these props for style overrides Button class/ui prop, Alert class/ui prop.
---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@679734274840330384> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
WiFi Plug
WiFi PlugOP3mo ago
@kapa.ai i tried that already and it didn't work can we try the ui prop
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Yes, you can use the ui prop to override the alignment styles of the UButton or UAlert components. The ui prop allows you to target specific slots within the component and apply custom classes. For UButton, you can override the base slot to change the alignment. For UAlert, you can also use the ui prop to adjust its internal layout if needed. Here’s how you might use the ui prop on UButton to align its content to the start:
<UButton
color="info"
variant="ghost"
size="lg"
block
class="p-0"
:ui="{ base: 'justify-start items-start' }"
>
<UAlert
color="info"
variant="subtle"
title="djffdghj"
description="fghjfghjgfhj"
icon="i-lucide-target"
/>
</UButton>
<UButton
color="info"
variant="ghost"
size="lg"
block
class="p-0"
:ui="{ base: 'justify-start items-start' }"
>
<UAlert
color="info"
variant="subtle"
title="djffdghj"
description="fghjfghjgfhj"
icon="i-lucide-target"
/>
</UButton>
If the alignment is still not as expected, you can also try applying the ui prop to the UAlert component to override its root alignment:
<UAlert
color="info"
variant="subtle"
title="djffdghj"
description="fghjfghjgfhj"
icon="i-lucide-target"
:ui="{ root: 'items-start' }"
/>
<UAlert
color="info"
variant="subtle"
title="djffdghj"
description="fghjfghjgfhj"
icon="i-lucide-target"
:ui="{ root: 'items-start' }"
/>
The ui prop is documented as the recommended way to override slot styles for both UButton and UAlert components, and it takes precedence over global configuration and variants [Button ui prop] [Alert ui prop]. If these approaches do not resolve the alignment, the knowledge sources do not provide further details for this specific nested scenario. In that case, you may need to inspect the rendered HTML and adjust the slot or root classes accordingly. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@679734274840330384> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
WiFi Plug
WiFi PlugOP3mo ago
@kapa.ai nuxt ui i want the border on modals to be border-accented where do i put that
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- To set the border on all Nuxt UI modals to use the border-accented style, you should override the modal component’s theme globally in your app.config.ts file. You can do this by customizing the ui property for the modal component and specifying the desired border class for the appropriate slot (usually root or base). For example:
export default defineAppConfig({
ui: {
modal: {
slots: {
root: 'border border-accented'
}
}
}
})
export default defineAppConfig({
ui: {
modal: {
slots: {
root: 'border border-accented'
}
}
}
})
This will apply the border and border-accented classes to the root of all modals, giving them the accented border style. You can adjust the slot name if the modal component uses a different slot for its border (commonly root or base). This approach is based on the documented method for globally overriding component themes in Nuxt UI using the app.config.ts file and the slots property structure [Theme Config]. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@679734274840330384> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
WiFi Plug
WiFi PlugOP3mo ago
@kapa.ai "ring ring-default" it seems to use ring be default
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Yes, by default, Nuxt UI modals use a ring for their border, specifically the class ring ring-default. This can be seen in the modal theme configuration:
fullscreen: {
true: {
content: 'inset-0'
},
false: {
content: 'top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[calc(100vw-2rem)] max-w-lg max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)] rounded-lg shadow-lg ring ring-default'
}
}
fullscreen: {
true: {
content: 'inset-0'
},
false: {
content: 'top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[calc(100vw-2rem)] max-w-lg max-h-[calc(100dvh-2rem)] sm:max-h-[calc(100dvh-4rem)] rounded-lg shadow-lg ring ring-default'
}
}
So, unless you override it, the modal will have a ring (Tailwind's ring utility) with the color set to ring-default by default. If you want to change this to ring-accented, you can override the relevant slot in your app.config.ts as described previously Modal Theme. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@679734274840330384> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?