Skip to main content
Vuetify0 is now in alpha!
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

API reference for the createContext composable.

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?

Ctrl+/