Learn how to handle server-side rendering with client-side-only charts in your Nuxt application.
Important: Nuxt Charts is based on Unovis, which uses D3.js and is not optimized for server-side rendering.
Create chart components with the .client.vue
suffix to prevent them from being imported on the server side.
Wrap your chart components with the <ClientOnly>
tag to ensure they only render on the client side.
Warning: Don't wrap individual chart components inside a component that already uses charts. Instead, wrap the entire parent component.
You can disable server-side rendering for your entire Nuxt app by setting ssr: false
in your nuxt.config.ts
:
Note: Disabling SSR globally is only recommended if your entire application does not require server-side rendering. For most use cases, prefer the .client.vue
convention or <ClientOnly>
wrapper for specific components.
Use the .client.vue
naming convention for chart components.
Wrap entire components that contain charts with the <ClientOnly>
tag.
Don't nest <ClientOnly>
tags within components that already use charts.
All components are built with Nuxt UI v3, TypeScript, and Tailwind CSS for maximum flexibility
Everything you need to know about our templates