Layout
App
Wraps the app to set the language every component renders in and to mount the toast stack.
<UiApp />Options
One block per prop — what it does, and what it looks like set.
Locale
locale sets the language every component below it renders in, and the locale Intl formats its dates and times with. Import one of the six bundled locales, or build your own with defineLocale().
Datei hier ablegen
Toaster
App mounts the toast stack for you, so useToast() works anywhere without placing a Toaster by hand. Pass options to position it, or null to render none and place your own.
Examples
The component in real use: compositions that answer "how do I build X with this", rather than one prop at a time.
Following the app's language
With @nuxtjs/i18n installed, hand App the locale matching the active language and both halves switch together — your own copy and the library's.
Rewording one string
extendLocale deep-merges over a locale, so you name only what changes. Everything you leave out keeps its shipped wording, in whatever language you started from.
API Reference
Generated from the component's source — props, slots and emits as the component actually declares them.
Props
Locale<Messages>The bundled English locale.AppToasterProps | null{}Slots
defaultTypes
type ToasterPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";interface AppToasterProps {
/** @defaultValue 'bottom-right' */
position?: ToasterPosition;
/** When false, toasts collapse into a peeking stack instead of a fully expanded list. @defaultValue true */
expand?: boolean;
/** Maximum number of toasts rendered at once. @defaultValue 5 */
max?: number;
}type Messages = (typeof en)["messages"];