@vue-interface/variant

The contextual variant mixin for interface components.
1,925
Install
npm install @vue-interface/variant@1.3.1
Latest Version:1.3.1
Vue:2
License:ISC
Last Updated:Jan 22, 2026
Links: GitHub  ·  npm
Maintainer: actengage

Variant

A mixin that adds contextual variations to components. This usually deals with the color or the way a component is displayed. This mixin is inherited by many components.

[[toc]]

Installation

NPM

npm i @vue-interface/variant

Yarn

yard add @vue-interface/variant

Options

variant

  • Type: string
  • Default: primary

The default component variant.

variantPrefix

  • Type: string
  • Default: kebabCase(this.$options.name)

The variant prefix. By default, the kebab component name is used.

variantClass

  • Type: string
  • Default: prefix(this.variant, this.variantPrefix)

variantClassPrefix

  • Type: string
  • Default: kebabCase(this.variantPrefix)

The computed variant class prefix.

Tailwindcss

Plugin

If you want to include Alerts in your Tailwindcss build, then intall the plugin.

module.exports = {
    plugins: [
        require('@vue-interface/variant/tailwind')
    ]
};

Theme

These are the default values. Only override what you need.

module.exports = {
    theme: {
        variations: {
            primary: theme('colors.blue.500', '#9E9E9E'),
            secondary: theme('colors.gray.600', '#718096'),
            danger: theme('colors.red.600', '#E53E3E'),
            success: theme('colors.green.500', '#48BB78'),
            warning: theme('colors.orange.500', '#ED8936'),
            info: theme('colors.teal.400', '#68D391'),
            dark: theme('colors.gray.800', '#2D3748'),
            light: theme('colors.gray.100', '#F7FAFC'),
            muted: theme('colors.white', '#FFF')
        }
    }
}

Related Packages

@vue-interface/form-control

An abstract form control Vue mixin.

9,987 3
@vue-interface/modal

A Vue modal component.

5,737 3
@vue-interface/btn

A Tailwind CSS utility for buttons.

4,586 3
@vue-interface/dropdown-menu

A Vue dropdown menu component.

4,026 3

Version History

Version Released Vue License
1.3.1 ^2.6.14 ISC
1.3.0 ^2.6.14 ISC
1.2.1 ^2.6.14 ISC
1.2.0 ^2.6.14 ISC
1.1.8 ^2.6.14 ISC
Pre-releases (4)
Version Released Vue License
3.0.0-beta.1 ^3.0.0 ISC
2.0.0-beta.2 ^3.0.0 ISC
2.0.0-beta.1 ^3.0.0 ISC
2.0.0-beta.0 ^3.0.0 ISC