getCurrentInstanceName

Commons
stable

Returns the kebab-case name of the currently active Vue component, resolved from aliasName, name, or __name. Useful for generating stable, component-scoped CSS class prefixes inside composables.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

name
string
'composable'
Name passed to the underlying getCurrentInstance call for error messages. Defaults to "composable".

API

Return value

The value returned by this util.

The kebab-case component name string derived from the active instance, e.g. "origam-btn" from "OrigamBtn".

Usage

Examples

Ready-to-paste usage snippets.

Derive CSS class prefix from component name

typescript