Custom Styling
Nuxt Snackbar ships its own styles and doesn’t depend on your CSS framework, so these options work the same whether you use Tailwind, Vuetify, plain CSS, or nothing at all. You can still hook into your own classes when you want to.
Border-style messages
Section titled “Border-style messages”Instead of a solid colored background, you can render messages with a tinted background and a colored accent border on one edge. Set border to the edge you want, then tune the background:
export default defineNuxtConfig({ modules: ['nuxt-snackbar'], snackbar: { border: 'left', // accent border on the left edge baseBackgroundColor: '#ffffff', backgroundOpacity: 0.12, // how strongly the type color tints the background },})borderaccepts'top' | 'bottom' | 'left' | 'right' | 'start' | 'end'(usestart/endfor RTL-aware edges).backgroundColorsets the background color for border-style messages (defaults tocurrentColor, which follows the type color).baseBackgroundColoris the base surface the tint is layered over (defaults to#ffffff).backgroundOpacitycontrols how strong that tint is.
Custom type colors
Section titled “Custom type colors”Override the per-type colors with any CSS color (hex shown here):
export default defineNuxtConfig({ modules: ['nuxt-snackbar'], snackbar: { success: '#16a34a', error: '#dc2626', warning: '#d97706', info: '#2563eb', },})Density and shadow
Section titled “Density and shadow”Make messages more compact with dense, and control the drop shadow with shadow:
export default defineNuxtConfig({ modules: ['nuxt-snackbar'], snackbar: { dense: true, // reduced vertical padding shadow: 'lg', // boolean, or one of 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' },})Extra classes
Section titled “Extra classes”Attach your own CSS classes to every message or to the action area — useful for hooking into a design system or framework utilities:
export default defineNuxtConfig({ modules: ['nuxt-snackbar'], snackbar: { messageClass: 'my-toast rounded-xl font-medium', messageActionClass: 'my-toast-action', },})Per-message background
Section titled “Per-message background”Override the background color for a single message with the background field on add():
const snackbar = useSnackbar()
snackbar.add({ text: 'Custom one-off styling.', background: '#111827',})Next steps
Section titled “Next steps”- Configuration — the complete option reference.
- Usage — all per-message fields, including
messageClasscompanions likeactionanddismissible.