Illustration3.0
The Anchor Illustrations help maintain visual consistency across our applications and platforms by providing a unified language for conveying information.
Introduction
The Anchor Illustrations help maintain visual consistency across our applications and platforms by providing a unified language for conveying information. They serve as visual cues that guide users through the interface, making interactions more intuitive and efficient.
The Illustrations within Anchor are created as vector graphics, allowing them to scale seamlessly across different screen sizes and resolutions. This scalability ensures that illustrations remain crisp and clear, whether viewed on a high-resolution monitor or a mobile device.
Installation
npm i @tryg/vue-ui-libraryUsage
<template>
<div style="width: 400px">
<anchor-illustration name="female-with-shirt"></anchor-illustration>
</div>
</template>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-illustration name="female-with-shirt"></anchor-illustration>
</template>Import only the components you need for optimal bundle size.
<script setup>
import { AnchorIllustration } from '@tryg/vue-ui-library';
</script>
<template>
<anchor-illustration name="female-with-shirt"></anchor-illustration>
</template>Available Illustrations
The following illustrations are available in the Anchor design system. Pass the corresponding name to the name prop to use any of them.
<template>
<anchor-illustration name="advisor"></anchor-illustration>
</template>CSS variables
You can customize the appearance of illustrations using the following CSS custom properties:
| Property | Description | Default |
|---|---|---|
--illustration-base-color | Set the base/tint color of the illustration | — |
--illustration-primary-color | Set the primary color of the illustration | var(--b-color-primary-default) |
--illustration-stroke-width | Set the stroke width of the illustration | 1.5 |
<template>
<anchor-illustration name="female-with-shirt" style="--illustration-primary-color: var(--b-color-success-default); --illustration-stroke-width: 2.5"></anchor-illustration>
</template>Accessibility
Illustrations are often decorative elements that support the surrounding content. How you handle accessibility depends on their purpose:
-
Decorative illustrations — When an illustration is purely decorative and adds no meaningful information, set
aria-hidden="true"to hide it from assistive technologies:<template> <anchor-illustration name="office" aria-hidden="true"></anchor-illustration> </template> -
Informational illustrations — When an illustration conveys important meaning, provide an accessible label using
aria-labeloraria-labelledbyto reference a nearby descriptive element:<template> <anchor-illustration name="signed-document" aria-label="Your document has been signed"></anchor-illustration> </template>
Always ensure that any information communicated visually through an illustration is also available through text or assistive technology.
API
anchor-illustration
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
name | name | This the type of illustration that you want to use | "advisor" | "female-close-up" | "female-with-bun" | "female-with-shirt" | "living-room" | "male-close-up" | "male-with-beard" | "male-with-shirt" | "office" | "signed-document" | undefined |
CSS Custom Properties
| Name | Description |
|---|---|
--illustration-base-color | Set the color of the illustration. |
--illustration-primary-color | Set the color of the illustration. @default var(--b-color-primary-default) |
--illustration-stroke-width | Set the stroke width of the illustration. @default 1.5 |
Built with StencilJS
