Skip to main content
Vuetify0 v1.0 is here
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

createContext API

Type-safe dependency injection factory built on Vue's provide/inject. Shares state across component trees without prop drilling.

Explore these related pages for additional context and usage patterns.

PageCategory
createContextFoundation
createTrinityFoundation
createPluginFoundation
CoreFundamentals

Functions

useContext

(key: ContextKey<Z>, defaultValue?: Z | undefined) => Z

Injects a context provided by an ancestor component.

provideContext

(key: ContextKey<Z>, context: Z, app?: App<any> | undefined) => Z

Provides a context to all descendant components.

createContext

(keyOrOptions?: ContextKey<Z> | CreateContextOptions | undefined, defaultValue?: Z | undefined) => readonly [() => Z, (context: Z, app?: App) => Z] | readonly [(key: string, defaultValue?: Z) => Z, (key: string, context: Z, app?: App) => Z]

Options

suffix

string | undefined

Optional suffix to append to the runtime key

Was this page helpful?

© 2016-1970 Vuetify, LLC
Services
Ctrl+/