Theme provider3.0
The theme provider component is a non-visual component, designed to help you set the correct theme for your Anchor components.
Installation
npm i @tryg/vue-ui-libraryUsage
Provide the Theme Provider with the brand and branch you want to use. The component will load the correct styles for the brand and branch you provide.
Install the component library as a Vue plugin. This globally registers all Anchor components.
import { createApp } from 'vue';
import { ComponentLibrary } from '@tryg/vue-ui-library';
import App from './App.vue';
const app = createApp(App);
app.use(ComponentLibrary);
app.mount('#app');<template>
<anchor-theme-provider branch="dk" brand="trygdk">Your content here</anchor-theme-provider>
</template>Import only the components you need for optimal bundle size.
<script setup>
import { AnchorThemeProvider } from '@tryg/vue-ui-library';
</script>
<template>
<anchor-theme-provider branch="dk" brand="trygdk">Your content here</anchor-theme-provider>
</template>You are responsible for pairing the correct brand and branch. If you provide an incorrect brand or branch, the component will not load the correct styles.
To use the base theme for each branch, provide the branch name and set the brand to "base".
Fonts
The Theme Provider will only load the CSS for basic values for the brand and branch you provide. You will have to make sure that your page has the correct fonts loaded.
Accessibility
- The Theme Provider is a non-visual component and has no direct impact on accessibility.
- It applies CSS custom properties and style sheets to child elements, which does not affect the DOM structure or accessibility tree.
- Ensure that font loading is handled separately, as the Theme Provider does not load fonts. Improper font loading can cause content reflow, which may trigger screen reader re-announcements.
- Theme transitions should be subtle and respect user preferences for reduced motion to avoid discomfort.
- The component wraps its children in a host element that should not contain interactive elements directly to maintain proper semantic structure.
API
anchor-theme-provider
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
branch | branch | string | undefined | |
brand | brand | string | undefined |
Built with StencilJS
Grid column
The grid-column component is a non-visual layout component that can be used to create a grid layout. It works as a child component of the grid-row component.
Autocomplete
Autocomplete allows users to search through a list of options and select a value. It supports keyboard navigation, custom filtering, and rich options with labels and descriptions.
