Plugin Options
Make Inkline your own by changing its many global configuration options.
You can configure some of Inkline's behaviour globally using the config field of the Vue Plugin integration.
Here are the default configuration options:
import { Inkline, components } from '@inkline/inkline';
app.use(Inkline, {
color: '',
colorMode: 'system',
colorModeStrategy: 'localStorage',
components,
componentOptions: {},
icons: {},
locale: 'en',
renderMode: 'client',
routerComponent: 'RouterLink',
size: '',
validateOn: ['input', 'blur']
});color
- Type:
'light' | 'dark' | string - Default:
'' - Description:
Sets the default
colorproperty value to use for components. When left empty, the prop default value will change from light to dark according to the chosencolorMode.main.tsapp.use(Inkline, { color: '' });
colorMode
- Type:
'system' | 'light' | 'dark' | string - Default:
'system' - Description:
Sets the preferred color mode to the chosen option. When set to
system, it will useprefers-color-scheme: darkto determinelightordarkmode.main.tsapp.use(Inkline, { colorMode: 'system' });
colorModeStrategy
- Type:
'localStorage' | null - Default:
'localStorage' - Description:
Sets the caching mechanism for storing the
colorMode.main.tsapp.use(Inkline, { colorModeStrategy: 'localStorage' });
components
- Type:
Record<string, Component> - Default:
{} - Description:
Register components globally during plugin installation.
main.tsimport { IButton } from '@inkline/inkline/components'; app.use(Inkline, { components: { IButton } });
componentOptions
- Type:
Record<string, Record<string, any>> - Default:
{} - Description:
Used to override the
colorandsizeprop default values of specific components.main.tsapp.use(Inkline, { componentOptions: { IButton: { color: 'primary', size: 'lg' } } });
icons
- Type:
Record<string, Svgson> - Default:
{} - Description:
This is defined in Svgson format and used for internal Inkline icons only. We would recommend using a tool like unplugin-icons for dynamically loading thousands of individual icons.
main.tsapp.use(Inkline, { icons: { inkCaretDown: { name: 'svg', type: 'element', value: '', attributes: { version: '1.1', xmlns: 'http://www.w3.org/2000/svg', width: '16', height: '28', viewBox: '0 0 16 28', fill: 'currentColor' }, children: [{ name: 'title', type: 'element', value: '', attributes: {}, children: [{ name: '', type: 'text', value: 'caret-down', attributes: {}, children: [] }] }, { name: 'path', type: 'element', value: '', attributes: { d: 'M16 11c0 0.266-0.109 0.516-0.297 0.703l-7 7c-0.187 0.187-0.438 0.297-0.703 0.297s-0.516-0.109-0.703-0.297l-7-7c-0.187-0.187-0.297-0.438-0.297-0.703 0-0.547 0.453-1 1-1h14c0.547 0 1 0.453 1 1z' }, children: [] }] }; } });
locale
- Type:
'en' | string - Default:
'en' - Description:
Sets the locale to be used for generic messages such as validation errors.
main.tsapp.use(Inkline, { locale: 'en' });
renderMode
- Type:
'client' | 'universal' - Default:
'client' - Description:
Set the render mode to Client or Universal (SSR/SSG). This is mainly used for storing the preferred
colorModecorrectly and is handled automatically by our available integrations.main.tsapp.use(Inkline, { renderMode: 'client' });
routerComponent
- Type:
Component | string - Default:
'client' - Description:
Sets the routing component to be used for
Linkablecomponents such as<IButton>,<IListGroupItem>,<INavItem>and<INavbarBrand>. When using a string type, the component must be registered globally.main.tsapp.use(Inkline, { routerComponent: 'RouterLink' });
size
- Type:
'sm' | 'md' | 'lg' | string - Default:
'' - Description:
Sets the default
sizeproperty value to use for components. When left empty, the prop default value will fallback tomd(medium) size.main.tsapp.use(Inkline, { size: '' });
validateOn
- Type:
Array<'input' | 'blur' | string> - Default:
['input', 'blur'] - Description:
Sets the events that trigger the form validation.
main.tsapp.use(Inkline, { validateOn: ['blur'] });