# Envision Docs > Documentation for the Envision UI framework. ## Colors – Basic colors URL: https://envisionui.io/colors/basic-colors/ Description: The “Basic colors” section defines general colors for backgrounds, text, links, and borders. There are a few general colors that are used for larger sections or less defined parts of components. For example, `--env-section-background-color` is used as background color for Modal dialogs. - `--env-background-color` - Theme/body background color - `--env-section-background-color` - Used for larger content sections. - `--env-section-background-color-05` - `--env-font-color` - Base text color - `--env-link-font-color` - Base link color - `--env-link-hover-font-color` - Base link:hover color - `--env-border-color` - Base border color - `--env-border-color-05` - Alternative border color `--env-section-background-color-05` is calculated from `--env-section-background-color`. `--env-border-color-05` is calculated from `--env-border-color`. ## Accessibility Font and link colors should have at least a 4.5:1 contrast ratio on `--env-background-color` and `--env-section-background-color`. Depending on design and usage, it´s recommended to try to get at least a 4.5:1 contrast ratio on `--env-section-background-color-05` as well. ## Examples `--env-background-color` is used outside the centered boxes. ```html
Base text on section background with a border 05 and a link.
Base text on section background 05, standard border and a link.
``` ## Legacy colors Deprecated The following colors are deprecated and will be removed. - env-bg-color--brand - env-bg-color--success - env-bg-color--info - env-bg-color--warning - env-bg-color--danger - env-bg-color--hover - env-bg-color--base - env-bg-color--darker - env-bg-color--dark - env-bg-color--normal - env-bg-color--light - env-bg-color--lighter - env-bg-color--lightest - env-color--brand - env-color--success - env-color--info - env-color--warning - env-color--danger - env-color--hover - env-color--base - env-color--darker - env-color--dark - env-color--normal - env-color--light - env-color--lighter - env-color--lightest - env-border-color-light --- ## Colors – Block colors URL: https://envisionui.io/colors/block-colors/ Description: The “Block colors” section offers preset color combinations for large content areas. Preset color combinations, use for larger blocks of content. ```html

Default

Bacon ipsum dolor amet beef cupim brisket pork turducken.

Primary

Bacon ipsum dolor amet beef cupim brisket pork turducken.

Secondary

Bacon ipsum dolor amet beef cupim brisket pork turducken.

``` --- ## Colors – Brand colors URL: https://envisionui.io/colors/brand-colors/ Description: The “Brand Colors” section defines primary brand hues with contrast-friendly shades for accessibility. An Envision theme will have one brand color and a matching contrast color. [The default theme](#brand-defaults) uses a neutral color. The brand color is used to generate a palette of lighter and darker variants. Each color in the palette has a matching contrast color verified against WCAG 2 AA.

Example branding of components

Badge

Section heading

Example profile image

Subheading

Caption

Section heading

Branded poll label 1
10 %
Branded poll label 2 (highlighted)
60 %
Branded poll label 3 Your vote
30 %

Example brand color palette

  1. Brand color
  2. Brand 05
  3. Brand 10
  4. Brand 15
  5. Brand 20
  6. Brand 25
  7. Brand 30
  8. Brand 35
  9. Brand 40
  10. Brand 45
  11. Brand 50
  12. Brand 55
  13. Brand 60
  14. Brand 65
  15. Brand 70
  16. Brand 75
  17. Brand 80
  18. Brand 85
  19. Brand 90
  20. Brand 95
  21. Brand 100
## Default brand color palette
  1. Brand color
  2. Brand 05
  3. Brand 10
  4. Brand 15
  5. Brand 20
  6. Brand 25
  7. Brand 30
  8. Brand 35
  9. Brand 40
  10. Brand 45
  11. Brand 50
  12. Brand 55
  13. Brand 60
  14. Brand 65
  15. Brand 70
  16. Brand 75
  17. Brand 80
  18. Brand 85
  19. Brand 90
  20. Brand 95
  21. Brand 100
Inverted themes where the font color is lighter than the section background color will result in an inverted (reversed) palette where `05` is the darkest and `100` is the lightest variant. --- ## Colors – Element colors URL: https://envisionui.io/colors/element-colors/ Description: The “Element Colors” section defines specific shades for buttons, icons, and interactive elements. Element colors are used for elements and components. See usage examples below.

Default

Light
Dark

Primary

Light
Dark

Secondary

Light
Dark

Success

Light
Dark

Warning

Light
Dark

Danger

Light
Dark

Info

Light
Dark

Primary & default

All elements use the same color setting.

Buttons:

Badge:
Primary
Radio button:
Checkbox:
Switch:
Menu:
Pagination:
Progress bar:
25%
Tabs:
Range slider:
-

Success

Button:
Badge:
Success
Alert:

Warning

Button:
Badge:
Warning
Alert:

Danger

Button:
Badge:
Danger
Alert:

Info

Button:
Badge:
info
Alert:
--- ## Colors – Status colors URL: https://envisionui.io/colors/status-colors/ Description: The “Status Colors” section provides distinct hues representing success, warnings, errors, and informational states. Status colors are UI colors that are used to signal a status, for example if a user is logged in or when new messages have arrived. Status colors have a main color and a matching contrast color for text. Status color text should be used when status color is applied to text on section background.

Neutral

Active

Active text

Attention

Attention text

Error

Error text

## Examples of usage

Badge

8 Logged in 42

Custom inline SVG decoration

Error message

Please enter a valid email address

Status badge

Lorem Ipsumsson

Logged in

Status badge on Profile image

Example profile image
Logged in

Text

Logged in

New message

An error occurred

Documentation of examples: - [Status variant Badge](/components/badge/#status-variant) - [Custom inline SVG decoration](/components/icons/#attention) - [Status badge](/components/badge/#status-badge) - [Status badge on Profile image](/components/profile-image/#status-badge) - [Form error message](/forms/form-elements/#validation) - [Text status colors](/typography/basic-text/#status-colors) --- ## Components – Accordion URL: https://envisionui.io/components/accordion/ Description: The Accordion component toggles the visibility of content sections, allowing users to expand or collapse them. ## Overview ```html

Example 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget lobortis dui, in accumsan augue. Quisque nec augue quam. Donec sed purus quam. Proin eu tincidunt metus.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget lobortis dui, in accumsan augue. Quisque nec augue quam. Donec sed purus quam. Proin eu tincidunt metus.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget lobortis dui, in accumsan augue. Quisque nec augue quam. Donec sed purus quam. Proin eu tincidunt metus.

``` ## Methods You can `show`, `hide` and `toggle` on available collapsible elements. ```javascript envision.accordion('#container1').then(function (accordions) { accordions[0].show(); }); ``` ```javascript envision.accordion('#container1').then(function (accordions) { accordions[0].hide(); }); ``` ```javascript envision.accordion('#container1').then(function (accordions) { accordions[0].toggle(); }); ``` --- ## Components – Alert URL: https://envisionui.io/components/alert/ Description: The Alert component displays brief, important messages to users, with variations for success, warning, danger, and info alerts. ## Variations ```html ``` --- ## Components – Badge URL: https://envisionui.io/components/badge/ Description: Use the Badge component to display small labels for status, notifications, or event counts. ## Overview ```html

Hello New

Hello New

``` ## Variants ```html Primary Success Warning Danger Info ``` ### Status variants ```html Neutral Active Attention ``` ### Brand Brand color badges are available by using modifier `env-badge--brand` or `env-badge--brand-{n}`. Valid values for `{n}` are: `05`, `10`, `15`, `20`, `25`, `30`, `35`, `40`, `45`, `50`, `55`, `60`, `65`, `70`, `75`, `80` , `85`, `90`, `95`, `100`.
Brand Brand 05 Brand 10 Brand 15 Brand 20 Brand 25 Brand 30 Brand 35 Brand 40 Brand 45 Brand 50 Brand 55 Brand 60 Brand 65 Brand 70 Brand 75 Brand 80 Brand 85 Brand 90 Brand 95 Brand 100
### Status badge Indicates active/inactive status. May be used on text elements and also in combination with [profile image](/components/profile-image/#status-badge). ```html

Last logged in 5 h

Logged in

``` --- ## Components – Breadcrumb URL: https://envisionui.io/components/breadcrumb/ Description: Use breadcrumbs to display the user´s location within a site’s hierarchy, enhancing navigation. Use `env-breadcrumb__separator` in combination with `aria-hidden="true"` to hide the separator character from assistive technology. ```html ``` --- ## Components – Cards URL: https://envisionui.io/components/cards/ Description: Cards are simple containers for displaying information about pages, groups, or users. Use Cards to display information about, for example, a page, a group or a user. A Card is a simple container that may have a header and a footer. A Card has no colors or shadows of its own. To add colors and shadows you may instead combine the `env-block` and `env-shadow` classes. If used inside a [Cardholder](/layout/cardholder/) the Card will stretch its width and height to make a nice aligned grid of cards. ```html

Lorem Ipsumsson

Example profile image

Lorem Ipsumsson

Job Title

lorem@domain.com

012-345 67 89

Open group • 29 members

Latest activity 3 hours ago

Lorem ipsum dolor

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget lobortis dui, in accumsan augue.

``` ## Card anatomy A Card may have a header, a body and a footer: `.env-card__header`, `.env-card__body`, `.env-card__footer`. No matter HTML source order, header will always display first and footer last. The footer will always stick to the bottom of the Card. Inside a Cardholder, if the Card needs to stretch vertically, the body of the Card will be the element that stretches. ```html
Header
Body
``` --- ## Components – Collapse URL: https://envisionui.io/components/collapse/ Description: The Collapse component toggles content visibility, allowing sections to expand or collapse as needed. ## Collapsible content ```html

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget lobortis dui, in accumsan augue. Quisque nec augue quam. Donec sed purus quam. Proin eu tincidunt metus.

``` Add `env-collapse--show` to have your content expanded ## Background Add `env-collapse-header` to give the collapsible header a background Add `env-collapse-header--icons` to add icons ```html

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget lobortis dui, in accumsan augue. Quisque nec augue quam. Donec sed purus quam. Proin eu tincidunt metus.

``` ## Methods Show ```javascript envision.collapse('#myCollapse').then(function (collapses) { collapses[0].show(); }); ``` Hide ```javascript envision.collapse('#myCollapse').then(function (collapses) { collapses[0].hide(); }); ``` Toggle ```javascript envision.collapse('#myCollapse').then(function (collapses) { collapses[0].toggle(); }); ``` --- ## Components – Dialog URL: https://envisionui.io/components/dialog/ Description: Use Dialog to present modal dialogs with customizable sizes, animations, and focus management. The Dialog component relies heavily on [The HTMLDialogElement interface](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement). The component must be initialized from Javascript. In the Envision scripted component you will find a few extra features: - Opener button added as option on initialization - Close on click outside as an option - Nice fade-in animation - Focus trap to keep tab navigation from leaving the dialog ## Default dialog

Dialog Title

Caticus cuteicus wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep.

### Basic dialog example ```html

Dialog Title

Caticus cuteicus wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep.

``` ```javascript envision.dialog(document.querySelector('#example-dialog-1'), { opener: '#example-dialog-1-opener', }); ``` ### Button alignment Use modifier `env-dialog__controls--end` to align controls to the right. ### Optional sizes Use `env-dialog--large` or `env-dialog--small` to control dialog size. ```html

Large dialog

Caticus cuteicus wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep.

Small dialog

Caticus cuteicus wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep.

``` ### Scrolling The element `env-dialog__main` is scrollable when content makes the dialog too large to fit the viewport. ```html

Scrollable dialog

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sapien turpis, aliquam nec porta ultrices, auctor ut mauris. Ut volutpat ornare consectetur. Phasellus nec nisi non tellus gravida porttitor a in arcu. Aliquam erat volutpat. Phasellus laoreet urna sem. In dui arcu, facilisis sed mollis at, bibendum vel purus. In sagittis lobortis tellus, sit amet egestas est dignissim vel. Vivamus a consequat nunc. Vestibulum eleifend malesuada quam id lacinia. Duis porta mauris et justo vehicula, sit amet malesuada tellus sollicitudin. Etiam convallis, ipsum non ultrices auctor, elit orci blandit est, vel finibus arcu massa eu lorem. Fusce sit amet est non tellus vulputate semper in eget est. In tincidunt ligula nec mauris tristique sagittis. Pellentesque interdum eleifend eros a viverra. Ut volutpat ut nisi nec gravida. Duis non sollicitudin ligula, ac vehicula turpis.

Duis eget lacus nec neque semper commodo. Nullam nisi nibh, vehicula eget condimentum sed, dictum vulputate erat. Quisque ut gravida magna. Cras eleifend maximus odio, quis tincidunt enim consectetur eu. Sed nec arcu auctor, porttitor eros malesuada, feugiat justo. Nulla ante augue, ultricies eu blandit et, vulputate sed nibh. Suspendisse in dapibus sapien. Fusce pulvinar, ligula vitae dapibus convallis, urna lectus viverra diam, a lobortis magna diam id libero. Duis et venenatis dolor, ac semper eros. Nunc tincidunt tempor enim.

Vivamus eget sagittis velit. Quisque magna libero, egestas a rutrum ac, imperdiet ac augue. Fusce nibh magna, sollicitudin sit amet massa in, iaculis tempus quam. Ut sodales commodo ante, in rutrum nunc semper quis. Vestibulum sed sollicitudin est. Etiam posuere id velit sit amet dictum. Nam semper placerat ultrices. Suspendisse in massa porttitor, faucibus neque sed, convallis velit. Nulla luctus ipsum a feugiat porta.

Duis ultricies gravida nunc, vitae fringilla sapien convallis ac. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent fermentum pellentesque euismod. Cras dictum feugiat nisi, tincidunt imperdiet nunc pharetra vitae. Nunc ut neque in metus tristique bibendum. Vivamus nec lorem odio. Vestibulum pellentesque cursus diam in tempor.

Praesent id diam elementum, consequat nisl vitae, congue turpis. Sed sit amet cursus quam, vitae sagittis lorem. Morbi erat lectus, tempus eget interdum ac, blandit sit amet ante. Praesent scelerisque bibendum quam ut ornare. Duis ipsum ex, tincidunt vel volutpat eget, bibendum eget odio. Duis vitae tristique eros. Praesent at dui et velit porttitor malesuada sit amet a elit.

Donec at augue quis dolor porta rutrum. Nullam fringilla lobortis sapien ac cursus. Ut id egestas odio, mattis ornare dui. Etiam interdum venenatis quam id lobortis. Nunc id enim luctus, porta leo vitae, tristique lectus. In vel tortor nec lacus facilisis euismod vitae porttitor ligula. Vivamus ut mauris id urna dictum vestibulum.

Mauris interdum fermentum turpis, at ullamcorper sapien accumsan sit amet. Phasellus vitae augue volutpat, convallis elit sed, eleifend nisl. Sed at lorem dui. Nunc scelerisque nisi sapien, non sollicitudin tellus luctus vitae. Vivamus molestie turpis eu enim blandit, rutrum egestas nisl hendrerit. Mauris pharetra commodo malesuada. Proin at nisl nec turpis lacinia hendrerit non non orci. Cras tempor quam a mauris placerat lacinia. Donec eget sem ac tellus porttitor hendrerit. Duis congue risus non eros pharetra, ut facilisis risus ullamcorper. Vivamus fringilla suscipit lorem eu fermentum. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris tristique, leo et laoreet imperdiet, leo ligula egestas nibh, at accumsan lorem nibh ut nulla. Vivamus vitae ornare est. Suspendisse convallis tortor et nulla porttitor dictum.

``` ## Alert dialogs Quote from [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/alertdialog_role): The alertdialog role is to be used on modal alert dialogs that interrupt a user's workflow to communicate an important message and require a response. To make a Dialog an alertdialog, add `role="alertdialog"`, and make sure to use an accessible name and description for example by adding attributes `aria-labelledby` and `aria-describedby`. **Note**: The option `backdropClick` will automatically be set to `false` for alertdialogs and cannot be overridden. Keypress `Escape` will not close the dialog. Available alertdialog variations: `env-dialog--'error', 'success', 'warning', 'info'` ```html

Alert Dialog

Caticus cuteicus wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep.

Success Dialog Title

Caticus cuteicus wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep.

Error Dialog Title

Caticus cuteicus wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep.

``` ## Options ```javascript // Default options { opener: null, backdropClick: true, placement: null, } ``` - `opener` _'string'_ | _Node_ - A selector as a string or a DOM Node to assign event listener for opening the dialog. - Default value: `null` - `backdropClick` _boolean_ - Click on backdrop (outside dialog) should close the dialog (not available for alertdialog). - Default value: `true` - `placement` _'string'_ - Dialog window should be moved in the DOM and open as an immediate child of ``. - Allowed values: `'body'` - Default value: `null` ## API Instances of Dialog may be controlled by the methods described below. ```javascript envision.dialog('#dialog', { opener: '#opener' }).then(function (dialogs) { console.log(dialogs[0].el.open); // dialogs[0].show(); // Uncomment to show dialog on load }); ``` ```javascript envision.dialog('#dialog').then(function (dialogs) { // Custom opener event document.querySelector('#opener').addEventListener('click', () => { // ... before show ... dialogs[0].show(); }); }); ``` ### Options - `el` - Access to the [HTMLDialogElement interface](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement), e.g. `open` and `returnValue`. - `show()` - Show the dialog. Uses [HTMLDialogElement showModal()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal) to always display the dialog in the [top layer](https://developer.mozilla.org/en-US/docs/Glossary/Top_layer). - `close()` - Close the dialog. ## Events Use [native HTMLDialogElement events](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement#events). ### Example ```javascript envision .dialog(document.querySelector('#dialog'), { opener: '#opener', }) .then((dialogs) => { dialogs[0].el.addEventListener('close', () => { // ... do something when dialog is closed console.log(dialogs[0].el.returnValue); }); }); ``` ## Legacy documentation Dialog is a replacement for the deprecated [Modal Dialog](/deprecated/modal-dialog/). --- ## Components – Dropdown URL: https://envisionui.io/components/dropdown/ Description: Dropdowns displays a list of options that appears upon user interaction. ## Default Dropdown Attribute `data-dropdown` is required on the button. Dropdown menu must use class `env-dropdown__menu` and should be located inside the same parent element as the button. ```html
``` ### Dropdown menu divider Add an empty list item to menu with the class `env-dropdown--divider` and `role="separator"`. ```html
``` ### Split button dropdown Use `env-button-group` to split buttons. ```html
``` ### Optional placement Use `data-container="body"` on ` ``` Default placement is aligned to start of button. Use `data-placement="end"` on `
``` --- ## Components – Embedded URL: https://envisionui.io/components/embedded/ Description: The Embedded component displays images and text with flexible layouts and overlay options. ## Example 1 ```html

Lorem ipsum

Bacon ipsum dolor amet beef cupim brisket pork turducken salami pig drumstick chuck ball tip biltong shoulder

``` ## Example 2 Uses `env-embedded--horizontal` and `env-embedded__img`. Use `env-embedded__img-container--right` to align image to the right. ```html

Lorem ipsum

Bacon ipsum dolor amet beef cupim brisket pork turducken salami pig drumstick chuck ball tip biltong shoulder porchetta tenderloin short loin.


Lorem ipsum

Bacon ipsum dolor amet beef cupim brisket pork turducken salami pig drumstick chuck ball tip biltong shoulder porchetta tenderloin short loin.

``` ## Example 3 ```html

Lorem ipsum

Bacon ipsum dolor amet beef cupim brisket pork turducken salami pig drumstick chuck ball tip biltong shoulder porchetta tenderloin short loin. Jowl pastrami drumstick pig, beef jerky chicken ham hock salami.

``` ## Example 4 Uses `env-embedded__block--overlay` to position text on top of image. You can align text to left or right with `env-embedded__block--overlay--left` or `*--right` ```html

Lorem ipsum

Bacon ipsum dolor amet beef cupim brisket pork turducken salami pig drumstick chuck ball tip biltong shoulder porchetta tenderloin short loin.

``` --- ## Components – Icons URL: https://envisionui.io/components/icons/ Description: The Icon component simplifies icon integration with customizable styles. ## Usage Use the `href` attribute to reference the icon in the included sprite. The name of the icon is the id of the symbol in the sprite. ```html ``` For custom SVG icons, set the class `env-icon` on the SVG element. ```html ``` ## Sizes Icon size utility classes are named using the format: `env-icon--{size}` Valid values for _size_ - `xx-small` - `x-small` - `small` - `medium` - `large` - `x-large` - `xx-large`
## Inactive An icon can be marked as inactive by adding modifier: `env-icon--inactive` which will lower opacity and add a hover effect. ```html
``` ## Attention For Envision icons and custom inline SVG images you may use modifier `env-icon--attention` on the icon or on part of an icon. The modifier will set the color to Status color Attention. ```html ``` --- ## Components – Image viewer URL: https://envisionui.io/components/image-viewer-2/ Description: The Image Viewer component displays slideshows and lightbox galleries with navigation controls. Image viewer 2 is an accessible, configurable component providing options for showing an image slideshow and/or a lightbox viewer with navigation between images.
Örebro Castle
Karlslund Manor House
Highland cattle at Oset outside Örebro
## Features include - Buttons for displaying the previous and next slides. - Button for stopping and restarting rotation. - Keyboard navigation support. - Aria-live announcement for image changes. - Optional automatic rotation, always disabled for users who prefers reduced motion. - Optional download button in lightbox. - Optional placement of slideshow buttons. ## Lightbox Use attribute `data-zoom` on one or more links inside the element being initialized from script. The lightbox opens with navigation arrows to switch between images. The link href:s should point to a large version of the image being shown. ```html
``` ```javascript envision.imageViewer2(document.querySelector('#example-imageviewer2-1')); ``` ## Slideshow ```html
Örebro Castle
Karlslund Manor House
Highland cattle at Oset outside Örebro
``` ```javascript envision.imageViewer2(document.querySelector('#example-imageviewer2-2'), { slides: { auto: 3000, playing: false, overlay: false, buttons: { type: 'secondary', size: 'slim', }, }, }); ``` ### Slideshow markup - All immediate child elements of the container will be included in slideshow. - The container used for initialization should have an `aria-label` attribute. ```html noexample
Image description Image description
``` #### Zoom Add attribute `data-zoom` to activate zoom/lightbox. Add URL to larger images in `data-href`. ```html noexample
Image description Image description
``` Optionally wrap the image in a link pointing to the larger image. The `href` attribute will be used for zoom and `data-zoom` should be added to the link, not the image. ```html noexample
Image description Image description
``` #### Caption Wrap images in a `figure` element and include a `figcaption` with the class `env-image-viewer-2__viewer__caption` to provide descriptive text. Captions can be combined with zoom functionality in two ways: - By adding `data-href` and `data-zoom` attributes directly on the
element. - By using an `` element with `href` and `data-zoom`, wrapping the image and caption. ```html noexample
Image 1 caption
Image 2 caption
``` #### Zoom and caption 2025.09.2 A `
` placed inside a `data-zoom` link or `
` will automatically be displayed in the lightbox. Alternatively, use the `data-figcaption` attribute on an `` to show caption text in the lightbox without rendering it in the slideshow. ```html noexample
Image 1 caption
``` ## Options ```js noexpand // Default options { slides: false, buttons: { download: true, showText: false, }, i18n: 'sv', } // Default slides options if set to true { auto: 0, speed: 300, draggable: true, playing: false, overlay: true, buttons: { type: null, ghost: false, size: null, }, }, ``` - `buttons` _{ download, showText }_ - Lightbox button options. Show/hide download button. Visible text in close/download buttons. - Default values: `{ download: true, showText: false }` - `i18n` _'sv'_ | _'en'_ | _'no'_ | _{ language keys }_ - Translation of buttons aria-label and aria-roledescription. Use predefined strings (Swedish, English, or Norwegian) or write your own translation. Default is 'sv'. - Available language keys: _roledescription, prev, next, pause, play, slideshow, zoom, largeImage, close, download, image, of_ - `slides` _boolean_ | _{ [options object](#slides-options-object) }_ - Initialize a slideshow with default or custom options - Default value: `false` ### Slides options object - `auto` _number_ - Auto rotation possible, play button visible. Number is interval in _ms_. - Default value: `0` (auto rotation not available) - `speed` _number_ - Slide speed in _ms_. - Default value: `300` - `draggable` _boolean_ - Slides listen to mouse drag events in addition to touch events. - Default value: `true` - `playing` _boolean_ - If `auto` is set to > 0, this will start auto rotation automatically. - Default value: `false` - `overlay` _boolean_ - Control buttons and caption should overlay the slides. - Default value: `true` - `buttons` _{ size, type, ghost }_ - Control button appearance. - Allowed value for `type`: Any Element color name in lowercase. - Allowed value for `size`: Any Button size name in lowercase. - Allowed value for `ghost`: true/false ## API functions Instances of Image viewer 2 may be controlled by the methods described below. ```javascript envision.imageViewer2('#image-viewer').then(function (imageViewers) { imageViewers[0].slider.pause(); imageViewers[0].lightbox.show(1); }); ``` ### Slider - `slider.pause()` - Pause slider automatic rotation. - `slider.play()` - Start slider automatic rotation if available. - `slider.next()` - Show next image. - `slider.prev()` - Show previous image. - `slider.goTo(index, speed)` - Set slider to image at position _index_. Use _speed_ to control how fast image is shown. - `slider.getPos()` - Get index for current image. ### Lightbox - `lightbox.show(index)` - Show lightbox starting at _index_. Defaults to index 0. - `lightbox.close()` - Close the lightbox. ## Legacy documentation Image Viewer 2 is a replacement for the following deprecated components: - [Image slider](/deprecated/image-slider/) - [Image viewer](/deprecated/image-viewer/) --- ## Components – List URL: https://envisionui.io/components/list/ Description: The List component displays items in vertical or horizontal layouts, with optional dividers. ## Overview `.env-list` resets defaults to `margin: 0`, `padding: 0`, `list-style: none` ## Vertical list ```html
  • Item
  • Item
  • Item
``` ### Dividers Apply `.env-list-dividers--*` to add dividers between items. Valid values: `top`, `bottom`, `around` ```html
  • Item
  • Item
  • Item
``` For a divider on a specific item, apply `.env-list-item-divider--*`. Valid values: `top`, `bottom`, `around` ```html
  • Item
  • Item
  • Item
``` ## Horizontal list ```html
  • Item
  • Item
  • Item
``` ### Dividers Apply `.env-list-dividers--*` to add dividers between items. Valid values: `right`, `left` ```html
  • Item
  • Item
  • Item
``` ### Fixed number of items per row Use modifiers `env-list--horizontal--fixed env-list--horizontal--fixed--*`. Valid values: `1-12` ```html
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
``` ### Responsive horizontal list ```html
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
``` ### Definition list #### Default ```html
First item
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sed faucibus orci, a tincidunt dui.
Second item
Pellentesque bibendum augue sit amet pellentesque ultrices.
Third item
Proin non lorem facilisis, tincidunt mi vitae, consequat justo.
``` #### Horizontal ```html
First item
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sed faucibus orci, a tincidunt dui.
Second item
Pellentesque bibendum augue sit amet pellentesque ultrices.
Third item
Proin non lorem facilisis, tincidunt mi vitae, consequat justo.
``` --- ## Components – Media URL: https://envisionui.io/components/media/ Description: The Media component is used to present user activity chronologically. ## Types ### Default media object ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` ### Default media object with actions menu ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` ### Inline media object ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` ### Column media object ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` ## Alignment ### Center ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` Alignment modifiers can also be applied to elements within the media container (`__figure` & `__body`) ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` ### Bottom ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` ## Order ### Reverse ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` ## Nesting ```html

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

Emma

Cras varius, felis a accumsan accumsan, tellus elit maximus purus, id dignissim sem odio at eros. Morbi vel commodo diam. Integer hendrerit tellus nec ligula egestas consequat. Curabitur sapien mauris, rhoncus non blandit eu, rhoncus ut sem. Pellentesque elementum non augue vitae scelerisque.

``` --- ## Components – Navigation URL: https://envisionui.io/components/navigation/ Description: The Navigation component provides customizable menus for site navigation, including menubars and side navigation. Use `aria-current="page"` on a link to indicate that the user is currently on that page. ## Menubar ### Fill ```html ``` ### Border ```html ``` ## Sidenav ```html ``` --- ## Components – News item URL: https://envisionui.io/components/news-item/ Description: The News Item component presents news content with images and text in a structured layout. ## Types ### Default news item ```html
Example image

Lorem ipsum

Eric Ericsson, aug 12 12:56

Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

``` ### Example: Vertical list `.env-list` ```html
  • Example image

    Lorem ipsum

    Eric Ericsson, aug 12 12:56

    Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

  • Example image

    Lorem ipsum

    Eric Ericsson, aug 12 12:56

    Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

  • Example image

    Lorem ipsum

    Eric Ericsson, aug 12 12:56

    Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

``` ### Example: Horizontal list `env-list env-list--horizontal--fixed env-list--horizontal--fixed--2` ```html
  • Example image

    Lorem ipsum

    Eric Ericsson, aug 12 12:56

    Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

  • Example image

    Lorem ipsum

    Eric Ericsson, aug 12 12:56

    Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

  • Example image

    Lorem ipsum

    Eric Ericsson, aug 12 12:56

    Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

  • Example image

    Lorem ipsum

    Eric Ericsson, aug 12 12:56

    Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

  • Example image

    Lorem ipsum

    Eric Ericsson, aug 12 12:56

    Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

  • Example image

    Lorem ipsum

    Eric Ericsson, aug 12 12:56

    Bacon ipsum dolor amet leberkas jowl tail, cow rump pork loin pancetta corned beef. Drumstick pork shank, salami turkey t-bone jerky corned beef picanha jowl brisket frankfurter shankle. Meatball jowl sausage pork belly chicken hamburger, andouille pork loin capicola.

``` --- ## Components – Pagination URL: https://envisionui.io/components/pagination/ Description: The Pagination component provides accessible navigation for multi-page content, with customizable alignment and sizing options. ## Overview ```html ``` ## States ### Current Use `aria-current="page"` or `aria-current="true"` on a link to indicate that the link is the current page or item. ```html ``` ### Disabled Any element except button without a href attribute is considered disabled. Buttons are disabled using the disabled attribute. If you must use a link, remove the href attribute and set the `aria-disabled="true"` and `aria-role="link"` attributes. ```html ``` ## Alignment ### Center ```html ``` ### End ```html ``` ## Sizes ### Small ```html ``` ### Large ```html ``` --- ## Components – Popover URL: https://envisionui.io/components/popover/ Description: Popovers displays contextual overlays with customizable content, positioning, and trigger options. ```html nocode

Popover

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In fermentum nunc bibendum laoreet malesuada. Proin eget augue tortor. Sed bibendum cursus eros, vitae mattis leo laoreet eget.

``` ## Configuration and initialization Initialize from script. Use data-attributes on the opener element or option parameters in JavaScript for settings. See [available options below](#options). ### Example using data-attributes ```html ``` ```javascript envision.popover('#example-popover-data'); ``` ### Example using JavaScript The content will be fetched from a template element and displayed in the popover. ```html ``` ```javascript const popoverContentEl = document.querySelector('#example-popover-content'); if (popoverContentEl) { envision.popover('#example-popover-button', { placement: 'bottom', title: 'Lorem ipsum', content: popoverContentEl, escapeContent: false, clickOutside: true, }); } ``` ## Popover menu Add `type: 'menu'` in JS or `data-type="menu"` in HTML for a menu-styled popover. Use class `env-popover__item` for the menu items.

Popover menu

```html ``` ```javascript const popoverMenuContentEl = document.querySelector( '#example-popover-menu-content' ); if (popoverMenuContentEl) { envision.popover('#example-popover-menu-button', { placement: 'top', title: 'Popover menu', content: popoverMenuContentEl, escapeContent: false, clickOutside: true, type: 'menu', }); } ``` ## Popover Tooltip Add `type: 'tooltip'` in JS or `data-type="tooltip"` in HTML for a Tooltip-styled popover. Common text components will adjust color automatically.

Popover Tooltip

Lorem ipsum dolor sit amet

```html ``` ```javascript const popoverTooltipContentEl = document.querySelector( '#example-popover-tooltip-content' ); if (popoverTooltipContentEl) { envision.popover('#example-popover-tooltip-button', { placement: 'top', title: 'Popover tooltip', content: popoverTooltipContentEl, escapeContent: false, clickOutside: true, type: 'tooltip', }); } ``` ## Options - `placement` _string_ - Prefered initial placement. - Default value: `top` - Possible values: `top`, `right`, `bottom`, `left` - `title` _string_ - Popover title. - Default value: `''` - `content` _string_ | _HTMLElement_ - Popover content. - Default value: `''` - `escapeContent` _boolean_ - Treat option `content` as text or HTML. If popover content is HTML, this needs to be set to `false`. - Default value: `true` - `trigger` _string_ - Single event or mulitple space separated events for opening the popover. - Default value: `click` - `delay` _number_ - Milliseconds for delaying the popover closing. When opening on hover, a value of at least `200` is recommended. - Default value: `0` - `clickOutside` _boolean_ - Close popover on click outside. - Default value: `false` - `type` _string_ - Popover styling - Default value: null - Possible values: `menu`, `tooltip` --- ## Components – Profile image URL: https://envisionui.io/components/profile-image/ Description: The Profile Image component displays images with fixed or responsive sizes. ## Overview `.env-profile-image` will always give you a centered image. Use modifiers for size:

`env-profile-image--xx-large`, `env-profile-image--x-large`, `env-profile-image--large`, `env-profile-image--medium`, `env-profile-image--small`, `env-profile-image--x-small`, `env-profile-image--xx-small` ### Fixed size Using the class directly on the IMG tag will make the image fixed size. If the containing element is smaller, the image will overflow. ```html
Example profile image xx-large
Example profile image x-large
Example profile image large
Example profile image medium
Example profile image small
Example profile image x-small
Example profile image xx-small
``` ### Responsive size Using a wrapper element will make the image resize if the element containing the image is smaller than the image. ```html
Example profile image
``` #### Status badge in responsive size Profile image A responsive size Profile image may have a [Status badge](/components/badge/#status-badge) inside. The text will be visually hidden and the badge will adjust its size relative to the image. ```html
Example profile image

Logged in

``` --- ## Components – Progress indicator URL: https://envisionui.io/components/progress/ Description: The Progress Indicator component displays progress with customizable colors, labels, and animations. ## Types ```html
``` ## Styling ### Labels ```html
25%
50%
75%
``` ### Colors Use modifiers `--success`, `--warning` or `--danger` to change background color of `env-progress__bar` ```html
``` ### Stripes Apply modifier `--striped` to enhance the progress bar with stripes ```html
``` Apply `--striped--flip` to flip stripes alignment ```html
``` ### Animated stripes Add `--striped--animated` to animate the stripes ```html
``` ## Poll ```html

Lorem ipsum lectus molestie vivamus?

Pellentesque rutrum duis
10 %
Diam bibendum
60 %
Nibh urna eu vitae sem donec in sem tellus ipsum Your vote
30 %
``` --- ## Components – Spinner URL: https://envisionui.io/components/spinner/ Description: The Spinner component displays loading animations with standard or bounce styles and optional delays. ## Standard ```html
``` ## Bounce ```html
``` ## Hide spinner Use modifier `env-spinner--hide` or `env-spinner-bounce--hide` to hide the spinner. i.e `env-spinner env-spinner--hide` ## Delayed spinner Delay showing the spinner to avoid spinner flashing when the content loads fast. Use modifier `env-spinner--fade-in` or `env-spinner-bounce--fade-in` for a delayed spinner. Data attribute `data-delay="short"` may be used to control delay timing. Allowed values are: - `short` (0.25s delay) - `medium` (0.5s) - `long` (1s) ### Delayed spinner demo ```html nocode
```
--- ## Components – Tab URL: https://envisionui.io/components/tab/ Description: The Tab component organizes content into sections, displaying one panel at a time. ## Default Tab Note: All examples below require tabs to be [initialized from JavaScript](#init). ```html
  • Tab 1
  • Tab 2
  • Tab 3
1
``` ## Simple Tab ```html
5
``` ## Stacked Add class modifier `env-tabs--column` to tab stack container to make tabs vertical. ```html
7
```
## Initiation ```javascript envision.tabs('.example-tabs'); ``` --- ## Components – Table URL: https://envisionui.io/components/table/ Description: Use a Table to display data in rows and columns, with customizable styles and responsive layouts. Default table styling uses the variables and styling from the [Text component](/components/text/). ## Types ### Default ```html
Default table
Name Username Department Email
John Doe johdoe Development john@doe.com
Jane Doe jandoe Development jane@doe.com
John Smith johsmi Marketing john@smith.com
Jane Smith jansmi Marketing jane@smith.com
``` ### Zebra ```html
Zebra table
Name Username Department Email
John Doe johdoe Development john@doe.com
Jane Doe jandoe Development jane@doe.com
John Smith johsmi Marketing john@smith.com
Jane Smith jansmi Marketing jane@smith.com
``` ## Borders `env-table--borders-*` Valid values `around`, `right`, `bottom`, `left` ```html
Table with borders
Name Username Department Email
John Doe johdoe Development john@doe.com
Jane Doe jandoe Development jane@doe.com
``` ## Sizing ### Small ```html
Small table
Name Username Department Email
John Doe johdoe Development john@doe.com
Jane Doe jandoe Development jane@doe.com
``` ### Large ```html
Large table
Name Username Department Email
John Doe johdoe Development john@doe.com
Jane Doe jandoe Development jane@doe.com
``` ## Contextual styling ### Hover effect ```html
Table with hover effect
Name Username Department Email
John Doe johdoe Development john@doe.com
Jane Doe jandoe Development jane@doe.com
John Smith johsmi Marketing john@smith.com
Jane Smith jansmi Marketing jane@smith.com
``` ### Colors Deprecated Table with colored rows and cells is deprecated and will be removed. --- ## Components – Toast URL: https://envisionui.io/components/toast/ Description: Use the Toast component to display brief, customizable notifications to inform users of system events. ```html
Hello, World! This is a Toast message.
Hello, World! This is a Toast message.
Hello, World! This is a Toast message. This Toast has several lines of toasty content!
``` --- ## Components – Tooltip URL: https://envisionui.io/components/tooltip/ Description: Use Tooltip to display brief, informative messages when users hover over or focus on elements. ```html Hover or focus A Tooltip ``` ## Initialization All elements with classname `env-tooltip` and one child element with `role="tooltip"` will be automatically initialized on `DOMContentLoaded`. Elements with other classnames and elements added to the DOM after document was loaded must be initialized from script. A child element with `role="tooltip"` is required. ```javascript // Initialize elements added after DOMContentLoaded envision.tooltip(); ``` **Note:** HTML is not allowed inside the tooltip. For advanced content, please use [Popover Tooltip](/components/popover/#tooltip). ## Configuration Use data-attributes or option parameters in JavaScript for settings. See [available options below](#options). ### Example using data-attributes ```html
Minimum of 8 characters
``` ### Example using JavaScript ```html Description of the button ``` #### Initialization of JavaScript example ```javascript const tooltipEl = document.querySelectorAll('.example-custom-init-tooltip'); if (tooltipEl) { envision.tooltip(tooltipEl, { placement: 'right', delay: 300, }); } ``` ## Options `envision.tooltip` takes two parameters: ```javascript envision.tooltip(element, options); ``` - `element` - You may pass any selector as a string, a DOM node or node list. Leave empty to initialize all new elements with class `env-tooltip`. - `options` - _{ placement, delay }_ - `placement` _string_ - Prefered initial placement. - Default value: `top` - Possible values: `top`, `right`, `bottom`, `left`, `auto`, - Possible value modifiers: `{value}-start`, `{value}-end` - `delay` _number_ - Milliseconds for delaying the popover opening and closing. - Default value: `200` --- ## Dashboard – Basics URL: https://envisionui.io/dashboard/basics/ Description: Basics of designing a dashboard widget ## Designing a Dashboard Widget Use Envision components when possible. When using custom CSS for styling, all colors should use Envision and Dashboard variables. Other colors and hard coded color values should be avoided. ### Wrapper Most dashboard widgets should be placed inside a wrapper element with class `env-dashboard-widget`. This will set the correct background, borders and more for the widget. The wrapper does not set a padding.

Simple widget

96%
```html noexample
``` ### Widget sizes There are four available sizes for a widget. The developer may decide which size or sizes a widget should support. The selected available sizes will be available as a user setting when the widget is added to a dashboard. The widgets will be placed in a grid with four columns. Depending on the available screen size and the selected widget size, a widget may use between one and four columns. A small widget will never use more than one column. An extra large widget will use as many as available. A small widget will not vary much in size, but a large widget may use anything between 250 and 1440 pixels width. For adapting a widget to different sizes, see [Responsive widgets](/dashboard/responsive-widgets/). #### Widget size table | Widget | Columns | Sizes (px) | | :---------- | :-----: | :--------: | | Small | 1 | 250–342 | | Medium | 1–2 | 250–708 | | Large | 1–3 | 250–1074 | | Extra Large | 1–4 | 250–1440 | ## Widget example ### Simplified code example This example shows basic usage of CSS classes for headings, labels and more. ```html noexample

Chart widget example heading

Legend line 1 Legend line 2

Y axis label

  • 1,200
  • ...

X axis label

  • 25 nov
  • ...
``` --- ## Dashboard – Responsive widgets URL: https://envisionui.io/dashboard/responsive-widgets/ Description: Use CSS container queries to make widgets responsive to different sizes. Some widgets may need to use a responsive design to fit different widths. Media queries should **not** be used since the width of the widget may not be relative to the viewport width. To make adaptions for [different widget sizes](/dashboard/basics/), use [CSS container queries](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_container_queries). The grid column container where the app will be displayed is a [containment context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_container_queries#using_container_queries) named `dashboard-widget`. ### Responsive widget example

Responsive example widget

96%

Resize this widget

```html noexample noexpand

Responsive example widget

96%

``` ```css noexpand @container dashboard-widget (max-width: 449px) { .example-responsive-widget .env-ui-text-kpi-number { font-size: var(--env-ui-text-kpi-number-font-size-small); color: var(--env-dashboard-color-pink-50); } } @container dashboard-widget (min-width: 580px) { .example-responsive-widget .env-ui-text-kpi-number { font-size: var(--env-ui-text-kpi-number-font-size-large); color: var(--env-dashboard-color-light-blue-90); } } ``` --- ## Dashboard – Widget colors URL: https://envisionui.io/dashboard/widget-colors/ Description: The widget color palette provides a set of colors that can be used to style widgets. Widgets should always use the widget color palette variables. In cases where using a variable is not possible, for example in an image, the HEX values from the palette should be used. ### Color palette Make sure color combinations are used that meets the WCAG 2 AA requirements. If unsure about a certain combination, please use a [color contrast checker](https://webaim.org/resources/contrastchecker/) to validate.
  • Black * #202330
  • White #ffffff

= The color will pass WCAG 2 level AA contrast requirements as text on white (widget wrapper) background.

* = The color also passes contrast requirements if used as text on gray-05 (theme body) background.

### Color palette CSS variable names Color variables are named `--env-dashboard-color-white`, `--env-dashboard-color-black` and `--env-dashboard-color-{colorName}-{variant}`. Available color names: `red`, `pink`,`purple`,`deep-purple`,`indigo`,`blue`,`light-blue`,`cyan`,`teal`,`green`,`light-green`,`lime`,`yellow`,`orange`,`brown`,`gray` Available variants: `05`, `20`, `50`, `90`, ### Color palette utility classes Simple decoration of areas may be done using CSS classes. Each palette color has a background and a foreground classname. Available classnames are `env-dashboard-bg-color-{colorName}-{variant}` where `colorName` and `variant` follow the same patterns as CSS variable names. ```html
This is a purple-20 area with default font color.
This is a purple-50 area with white font color.
``` --- ## Dashboard – Widget components URL: https://envisionui.io/dashboard/widget-components/ Description: Styles for widget components such as labels, values, and badges. ## Values and labels Additional styles only availble in widgets should be used for labels and values in charts and similar. ```html

Axis label / Label

Axis value / Legend

``` ### Key performance indicators For displaying key performance indicators you should use the `env-ui-text-kpi-number` class. Set different sizes using CSS variables `--env-ui-text-kpi-number-font-size-{x}`. ```html 96% 96% 96% 96% 96% ``` ```css .example-kpi-x-small { font-size: var(--env-ui-text-kpi-number-font-size-x-small); } .example-kpi-small { font-size: var(--env-ui-text-kpi-number-font-size-small); } .example-kpi-large { font-size: var(--env-ui-text-kpi-number-font-size-large); } .example-kpi-x-large { font-size: var(--env-ui-text-kpi-number-font-size-x-large); } ``` ## Badges If a value has changed for the better, the worse or is unchanged it may be displayed using one of the widget specific badges availble. ```html Down 18% No change Up 18% ``` --- ## Dashboard – Widget CSS variables URL: https://envisionui.io/dashboard/widget-css-variables/ Description: Additional CSS variables for styling dashboard widgets. ## Palette Colors - `--env-dashboard-color-black` - `--env-dashboard-color-white` - `--env-dashboard-color-red-05` - `--env-dashboard-color-red-20` - `--env-dashboard-color-red-50` - `--env-dashboard-color-red-90` - `--env-dashboard-color-pink-05` - `--env-dashboard-color-pink-20` - `--env-dashboard-color-pink-50` - `--env-dashboard-color-pink-90` - `--env-dashboard-color-purple-05` - `--env-dashboard-color-purple-20` - `--env-dashboard-color-purple-50` - `--env-dashboard-color-purple-90` - `--env-dashboard-color-deep-purple-05` - `--env-dashboard-color-deep-purple-20` - `--env-dashboard-color-deep-purple-50` - `--env-dashboard-color-deep-purple-90` - `--env-dashboard-color-indigo-05` - `--env-dashboard-color-indigo-20` - `--env-dashboard-color-indigo-50` - `--env-dashboard-color-indigo-90` - `--env-dashboard-color-blue-05` - `--env-dashboard-color-blue-20` - `--env-dashboard-color-blue-50` - `--env-dashboard-color-blue-90` - `--env-dashboard-color-light-blue-05` - `--env-dashboard-color-light-blue-20` - `--env-dashboard-color-light-blue-50` - `--env-dashboard-color-light-blue-90` - `--env-dashboard-color-cyan-05` - `--env-dashboard-color-cyan-20` - `--env-dashboard-color-cyan-50` - `--env-dashboard-color-cyan-90` - `--env-dashboard-color-teal-05` - `--env-dashboard-color-teal-20` - `--env-dashboard-color-teal-50` - `--env-dashboard-color-teal-90` - `--env-dashboard-color-green-05` - `--env-dashboard-color-green-20` - `--env-dashboard-color-green-50` - `--env-dashboard-color-green-90` - `--env-dashboard-color-light-green-05` - `--env-dashboard-color-light-green-20` - `--env-dashboard-color-light-green-50` - `--env-dashboard-color-light-green-90` - `--env-dashboard-color-lime-05` - `--env-dashboard-color-lime-20` - `--env-dashboard-color-lime-50` - `--env-dashboard-color-lime-90` - `--env-dashboard-color-yellow-05` - `--env-dashboard-color-yellow-20` - `--env-dashboard-color-yellow-50` - `--env-dashboard-color-yellow-90` - `--env-dashboard-color-orange-05` - `--env-dashboard-color-orange-20` - `--env-dashboard-color-orange-50` - `--env-dashboard-color-orange-90` - `--env-dashboard-color-brown-05` - `--env-dashboard-color-brown-20` - `--env-dashboard-color-brown-50` - `--env-dashboard-color-brown-90` - `--env-dashboard-color-gray-05` - `--env-dashboard-color-gray-20` - `--env-dashboard-color-gray-50` - `--env-dashboard-color-gray-90` ### Additional UI Text variables - `--env-ui-text-label-font-family` - `--env-ui-text-label-font-color` - `--env-ui-text-label-font-size` - `--env-ui-text-label-font-weight` - `--env-ui-text-label-text-transform` - `--env-ui-text-label-letter-spacing` - `--env-ui-text-value-font-family` - `--env-ui-text-value-font-color` - `--env-ui-text-value-font-size` - `--env-ui-text-value-font-weight` - `--env-ui-text-value-text-transform` - `--env-ui-text-value-letter-spacing` - `--env-ui-text-kpi-number-font-family` - `--env-ui-text-kpi-number-font-color` - `--env-ui-text-kpi-number-font-size` - `--env-ui-text-kpi-number-font-weight` - `--env-ui-text-kpi-number-text-transform` - `--env-ui-text-kpi-number-letter-spacing` - `--env-ui-text-kpi-number-font-size-x-small` - `--env-ui-text-kpi-number-font-size-small` - `--env-ui-text-kpi-number-font-size-medium` - `--env-ui-text-kpi-number-font-size-large` - `--env-ui-text-kpi-number-font-size-x-large` --- ## Dashboard – Widget typography URL: https://envisionui.io/dashboard/widget-typography/ Description: Typography guidelines for dashboard widgets. The widget theme uses [Inter](https://fonts.google.com/specimen/Inter) font family which has support for nine different weights 100-900. Other font familes should in most cases not be used. ```html nocode

Thin 100 — The quick brown fox jumps … 123456789

Extra Light 200 — The quick brown fox jumps … 123456789

Light 300 — The quick brown fox jumps … 123456789

Normal 400 — The quick brown fox jumps … 123456789

Medium 500 — The quick brown fox jumps … 123456789

Semi Bold 600 — The quick brown fox jumps … 123456789

Bold 700 — The quick brown fox jumps … 123456789

Extra Bold 800 — The quick brown fox jumps … 123456789

Black 900 — The quick brown fox jumps … 123456789

``` ```css /* Available weights 100–900 */ .example-fw-100 { font-weight: 100; } ``` ### Headings Widgets should use [UI Text](/typography/ui-text/) for headings. ```html

Overline

Heading

Section heading

Subheading

Caption / description

``` ### Dynamic font size in widgets Widgets already has a containment context which makes them dynamic font containers by default. Therefore the dynamic font container is **not** required. Here is an overview of how different size widgets will change size at different Dashboard grid sizes. The dashboard grid adapts between 1–4 columns depending on available screen space. | Widget | 1 column | 2 columns | 3 columns | 4 columns | | :---------- | -------: | --------: | --------: | --------: | | Small | 250–342 | 250–342 | 250–342 | 250–342 | | Medium | 250–523 | 524–708 | 534–708 | 524–708 | | Large | 250–523 | 524-812 | 813-1071 | 798–1074 | | Extra Large | 250–523 | 524-812 | 813-1071 | 1072–1440 | There are additional widget specific boundaries available for Dynamic fonts. Regular boundaries are documented on the [Dynamic font size page](/typography/basic-text/#dynamic-font-width-boundaries). Boundaries are set using modifier classes `env-dynamic-font--from-{value}` and `env-dynamic-font--to-{value}`. Additional boundaries for **from** values: `524`, `813`, `1072` Additional boundaries for **to** values: `342`, `523`, `708`, `812`, `1071`, `1440` --- ## Forms – Button group URL: https://envisionui.io/forms/button-group/ Description: Button Group groups related buttons together, providing a unified interface for multiple actions. ## Types ```html
``` --- ## Forms – Button URL: https://envisionui.io/forms/button/ Description: Buttons provide interactive elements with various styles, sizes, and icon options. ## Standard button types Buttons in Envision can be used to trigger actions (for example, save, submit, or close) or to navigate to other pages or routes. A button can be implemented as either a `

``` ## Call to Action button 2026.01.1 A call-to-action (CTA) button is a prominently styled button designed to encourage users to take a specific desired action. It is typically used in marketing-oriented layouts and links to a page, form, or other important destination. ```html

Call to Action

``` ### Call to action button color variants CTA buttons are available in brand and contextual color variants, allowing you to adapt the visual emphasis to different use cases and content contexts. Valid modifiers: `brand`, `primary`, `secondary`, `success`, `danger`, `info`, `warning` ```html

Call to Action Call to Action Call to Action

``` ## Sizes Standard buttons are available in four sizes: large, default, small, and slim. ```html

``` ## Block A block button spans the full width of its container. All button types and sizes, including CTA buttons, are available as block buttons. ```html

Call to Action

``` ## Standard button icons For standard buttons, additional modifier classes are used to position icons as desired. ### Icon button types ```html ``` ### Icon button sizes ```html ``` ### Small icon size ```html ``` ### Icon above Available in medium and large size. ```html ``` ## Call to Action button icons CTA buttons can also include icons, positioned before or after the text. No additional modifier classes are required for the button itself. The icons can be sized using the standard icon size modifier classes. ```html

Call to Action Call to Action

``` ## State ### Disabled The disabled state is available for standard buttons. ```html ``` --- ## Forms – Form elements URL: https://envisionui.io/forms/form-elements/ Description: Form elements structures user inputs with labels, controls, and consistent spacing. ## Basics Wrap the form in `.env-form`. Each form field combination of text label and form control may optionally be wrapped in `.env-form-field` for consistent spacing. The form field wrapper may also contain a help text using `.env-form-field-help`. ```html

Form field help

``` ### Form control container The class `.env-form-control` creates a multi purpose container used to enhance single form controls. It can only contain elements of the following types: - `.env-form-label` - `.env-form-input` - `.env-button` - `.env-icon` - `[aria-hidden="true"]` #### Usages Create an [input group](#input-group) with label, input and button with a combinations of elements using `.env-form-input`, `.env-button` and `.env-form-label`. ```html
``` [Option elements](#option-elements), such as radio buttons, checkboxes and switches in combination with a label should use the wrapper for alignment and spacing. Use the combination of `.env-radio`, `.env-checkbox` or `.env-switch` and `.env-form-label`. ```html
``` Add [icons](#input-icons) to input fields using the combination of `.env-form-input` and `.env-icon`. ```html
``` ## Input elements ```html
``` ### Search input element Use `.env-form-input` and `[type="search"]` for search input elements. Add modifier class `.env-form-input--search` to display a clear button. ```html
``` ### Textarea element Use `.env-form-input` for a textarea element. Add `rows` attribute to specify the number of visible text lines. The textarea will be resizable vertically. ```html
``` ### Contenteditable element Make sure to add `role="textbox"` and `aria-multiline="true"` to the contenteditable element. The contenteditable element should also have `aria-label` or `aria-labelledby` attribute since a native label element is not allowed. An optional placeholder may be added using attribute `aria-placeholder` on the contenteditable element. ```html
Contenteditable
``` ## Select element and component **Updated in 2025.05.1.** With the introduction of [Customizable select elements](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Customizable_select), both the Select element and the Select component support a progressively enhanced approach that applies as much of the Envision styling as possible while maintaining native select element functionality. This feature is opt-in and can be enabled by adding a `button` with a `selectedcontent` tag inside the select element. ### Select component A ` ``` ### Customizable select 2025.05.1 To opt in to the customizable version — which uses theme fonts, colors, and allows icons — add a `button` as the first child of the `select`, with a `selectedcontent` element inside the `button`. Use the `.env-icon` class to display icons in the options or in the selected value.
```html noexample
``` ### Select element Native select element with class `.env-form-input`. Only light styling, might look different in different browsers.
```html noexample
``` ## Option elements ### Radiobutton input element Related radiobutton elements should be wrapped by a fieldset element to indicate group membership of the contained elements. Use `.env-form-control` to wrap `.env-radio` and `.env-form-label. ```html
Radio button
``` ### Checkbox input element Related checkbox elements should be wrapped by a fieldset element to indicate group membership of the contained elements. Use `.env-form-control` to wrap `.env-checkbox` and `.env-form-label`. ```html
Checkbox
``` ### Switch component Use `.env-form-control` to wrap an `.env-switch` checkbox and `.env-form-label`. ```html
```
## Icons in input fields Use `.env-form-control` to wrap `.env-icon` and `.env-form-input`. ```html
``` ## Input group Wrap text, input and button with `.env-form-control` to create an input group. Use `.env-form-control` to wrap `.env-checkbox` and `.env-form-label`. ```html
``` ## States ### Disabled & Readonly Attribute `[disabled]` may be placed on form elements or fieldset elements to disable the form control(s). Attribute `[readonly]` is also available for input elements. ```html
Disabled radio button group
``` ## Validation error Add modifier `.env-form-field--error` to define error validation state. The `aria-describedby` attribute should be used to reference the `ID` of the text that describes the element. Error validation state uses the Status color [Error text](/colors/status-colors/). ```html

Error feedback

``` ## Deprecated [Deprecated legacy form classes and components can be found here](/deprecated/form/). --- ## Forms – Form layout URL: https://envisionui.io/forms/form-layout/ Description: Form Layout offers structured classes for creating accessible, consistent, and responsive form layouts. The class `.env-form-row` creates a multi purpose container used to create form layouts. The class `.env-form-column-{n}` inside a row will control the sizing of the columns. When using form layouts, generally the `.env-form-field` wrapper is not needed. ### Form columns Use `.env-form-row` as a wrapper for multiple `.env-form-column-{n}` elements to place form fields horizontally. Use `.env-form-column-{n}` to specify the width of an element relative to other elements on the row. Valid values are `1-6`. Default is `1`. Form fields may optionally be stacked below a certain container width. Use `.env-form-row--stack-{width}` to activate. Valid values for `{width}` is `s`, `m` and `l`. ```html resizeable
``` ### Horizontal form field Combine `.env-form-column-{n}` with `.env-form-label` and `.env-form-control` inside an `.env-form-row` element to place label and control horizontally. Use `.env-form-column-{n}` on the label or control element to specify the width of label and control relative to each other. Valid values are `1-6`. Default is `1`. Stacking is supported using `.env-form-row--stack-{width}`. Valid values for `{width}` is `s`, `m` and `l`. ```html resizeable
``` ### Inline option elements Use `.env-form-row` as a wrapper for multiple `.env-form-control` elements containing `.env-radio` or `.env-checkbox` to create a inline form layout for option inputs with consistent spacing vetically and horizontally. ```html resizeable
Radio buttons inline
``` --- ## Forms – Range slider URL: https://envisionui.io/forms/range-slider/ Description: The Range Slider component lets users select a value or range with customizable intervals and limits. Capture a range ```html
-
``` ```javascript envision.rangeSlider('#my-slider', object); ``` ## Options ### values - **Type:** Array - **Default:** [0, 0] Values to initialize the slider with. ```javascript envision.rangeSlider('#my-slider', { values: [20, 70], }); ``` ### min - **Type:** Number - **Default:** 0 The minimum value of the slider. ```javascript envision.rangeSlider('#my-slider', { min: 100, }); ``` ### max - **Type:** Number - **Default:** 100 The maximum value of the slider. ```javascript envision.rangeSlider('#my-slider', { max: 200, }); ``` ### step - **Type:** Number - **Default:** 1 The size of every step between min and max. The value range (max - min) should be evenly divisible by the step. ```javascript envision.rangeSlider('#my-slider', { step: 5, }); ``` ### visibleValues - **Type:** Boolean - **Default:** true If values should be visible below the handles. ```javascript envision.rangeSlider('#my-slider', { visibleValues: false, }); ``` ## Events ### input Triggered for every move during slide. ```javascript document.querySelector('#my-slider').addEventListener('input', (e) => { console.log('input', e.detail); }); ``` ### change Triggered when slide is completed. ```javascript document.querySelector('#my-slider').addEventListener('change', (e) => { // Triggered when slide is completed console.log('change', e.detail); }); ``` ### slide Deprecated Triggered for every move during slide. Event `slide` is deprecated, please use `input` event. ### slidestop Deprecated Triggered when slide is completed. Event `slidestop` is deprecated, please use `change` event. ## Methods ### values(values) Parameters - **values:** An array of values to set Set the values for the range. ```javascript envision.rangeSlider('#my-slider').then(function (sliders) { sliders[0].values([50, 90]); }); ``` --- ## Forms – Tag Select URL: https://envisionui.io/forms/tag-select/ Description: Tag Select enables customizable multi-select interfaces with cross-browser support and styling. Tag select is a JS alternative to ` ``` Initialize from script. You may pass any selector as a string, a DOM node or node list. ```javascript var tagSelect = envision.select('#example-tag-select-1'); ``` **Note:** `envision.select` will return a Promise. Use the instance method `.then()` to access individual controls. ```javascript tagSelect.then(function (selects) { selects[0].addOptions({ value: 'newOption', text: 'New option' }); }); ``` ## Single select Create a Single select by using a Tag select and set `maxItems` to `1`. Note: Clear and remove buttons will not be available in a single select. Use `allowEmptyOption` and `sortField` to make behaviour similar to native select element. ```html
``` ```javascript var singleSelectExample = envision.select('#example-tag-select-single-1', { maxItems: 1, allowEmptyOption: true, sortField: [{ field: '$order' }, { field: '$score' }], }); ``` ## Options - `maxItems` _number_ - The max number of items the user can select. - Default value: `null` (unlimited) - Set to `1` to create a Single select. - `create` _boolean_ - Allow adding new tags - Default value: `false` - `createFilter` _RegExp_ | _'string'_ | _function(input)_ - Specifies a RegExp or a string containing a regular expression that the current search filter must match to be allowed to be created. May also be a predicate function that takes the filter text and returns whether it is allowed. - `clearButton` _boolean_ - Show clear all button - Default value: `true` - Not available in Single select - `allowEmptyOption` _boolean_ - Only available in Single select - Option with no value will be selectable if set to true. - Default value: `false` - `placeholder` _'string'_ - Use a custom placeholder. - Default: Will try to use option with empty value or placeholder attribute from HTML first. - `dropdownParent` _'string'_ - The element the dropdown menu is appended to. - Default: Will be appended as a child of the control. - `options` _[{ value, text }]_ - Create a Tag select from custom dataset - By default this is populated from the original element. - `maxOptions` _number_ - Limits the number of visible options - Default value: `null` (unlimited) - `items` _['value']_ - An array of the initial selected values. - By default this is populated from the original element. - `i18n` _'sv'_ | _'en'_ | _'no'_ | _{ add, no_results, remove_button, clear_button }_ - Translation of remove button, clear button, add item and no results. Use predefined strings (Swedish, English, or Norwegian) or write your own translation. Default is 'sv'. - `load` _function(query, callback)_ - Loads options by invoking the provided function. The function should accept two arguments (query, callback) and should invoke the callback with the results once they are available. - `preload` _boolean_ | _'string'_ - If true, the load function will be called upon control initialization with an empty search. Alternatively it can be set to 'focus' to call the load function when control receives focus. - `labelField` _'string'_ - The name of the property to render as an option / item label when loading remote data. - `valueField` _'string'_ - The name of the property to use as the value when loading remote data. - `searchField` _'string'_ | _['string']_ - A string or an array of property names to analyze when filtering options in remote data. - `sortField` _'string'_ | _[object]_ | _function(a, b)_ - A string, an array of objects or a function to sort available options. - By default the the order is based on the current locale. - To disable sorting entirely and maintain the original order of options, use: `sortField:[{field:'$order'},{field:'$score'}]` - `render` _object_ - An object specifications for rendering. - Available options: - `item` _function(data, escape)_ - `option` _function(data, escape)_ - `option_create` _function(data, escape)_ - `no_results` _function(data, escape)_ - `loading` _function(data, escape)_ - The `escape` argument is a function that takes a string and escapes all special HTML characters. This is very important to use to prevent XSS vulnerabilities. - onEventName _function()_ - See Event handlers and Advanced example ## Advanced examples ### Options from JavaScript config This example sets the options from the config. It will allow adding tags from the Tag Select itself, or from a separate input using the API. ```html
``` ```javascript envision .select('#example-tag-select-2', { maxItems: 5, placeholder: 'Select or add tags...', create: true, // Allow creating tags render: { item: (data, escape) => `
${escape(data.text)}
`, }, items: ['fruit01'], // Preselect one existing option options: [ // Populate options { value: 'fruit01', text: 'Apple', }, { value: 'fruit02', text: 'Banana', }, { value: 'fruit03', text: 'Grapefruit', }, { value: 'fruit04', text: 'Lemon', }, { value: 'fruit05', text: 'Pear', }, ], onOptionAdd: function (value, data) { // Event handler, runs when option is added console.log('Added:', value, data); }, }) .then((selects) => { document .getElementById('example-tag-select-2-add') .addEventListener('click', function () { var val = document.getElementById('example-tag-select-2-tag').value; selects[0].addOptions({ value: val, text: val, }); selects[0].addItem(val); }); }); ``` ### Options from remote data API This example fetches repository names from GitHub. It will preload some popular names on page load. The data does not follow the Tag Select naming standards so value-/label-/search-/sortField must be defined. ```html
``` ```javascript envision.select('#example-tag-select-3', { maxItems: 5, placeholder: 'Select a GitHub repository...', i18n: 'en', valueField: 'url', labelField: 'name', searchField: ['name'], sortField: [{ field: 'name', direction: 'desc' }], preload: true, load: function (query, callback) { query = query || 'sitevision'; var url = 'https://api.github.com/search/repositories?q=' + encodeURIComponent(query); fetch(url) .then((response) => response.json()) .then((json) => { callback(json.items); }) .catch(() => { callback(); }); }, }); ``` ## States ### Disabled A Tag Select may be disabled by adding the `disabled` attribute in the HTML. When disabled, the control cannot receive focus. ```html
``` ### Locked A Tag Select may be locked by adding the class `env-select--locked` to the `` or `
``` ## Event handlers - `onInitialize` _function() { ... }_ - Invoked once the control is completely initialized. - `onChange` _function(value) { ... }_ - Invoked when the value of the control changes. - `onItemAdd` _function(value, $item) { ... }_ - Invoked when an item is selected. - `onItemRemove` _function(value) { ... }_ - Invoked when an item is deselected. - `onClear` _function() { ... }_ - Invoked when the control is manually cleared via the clear() method. - `onOptionAdd` _function(value, data) { ... }_ - Invoked when a new option is added to the available options list. - `onOptionRemove` _function(value) { ... }_ - Invoked when an option is removed from the available options. - `onOptionClear` _function() { ... }_ - Invoked when all options are removed from the control. - `onDropdownOpen` _function(dropdown) { ... }_ - Invoked when the dropdown opens. - `onDropdownClose` _function(dropdown) { ... }_ - Invoked when the dropdown closes. - `onType` _function(str) { ... }_ - Invoked when the user types while filtering options. - `onFocus` _function() { ... }_ - Invoked when the control gains focus. - `onBlur` _function() { ... }_ - Invoked when the control loses focus. - `onLoad` _function() { ... }_ - Invoked when new options have been loaded and added to the control via the load option. ## API functions Instances of Tag Select may be controlled by the methods described below. ```javascript envision.select('#tag-select').then(function (selects) { selects[0].addOptions({ value: 'test' }); selects[0].addItem('test'); }); ``` ### Options - `addOptions(data)` - Adds an available option, or array of options. If it already exists, nothing will happen. Note: this does not refresh the options list dropdown (use refreshOptions() for that). - `getOption(value)` - Retrieves the DOM element for the option identified by the given value. - `updateOption(value, data)` - Updates an option available for selection. If it is visible in the selected items or options dropdown, it will be re-rendered automatically. - `removeOption(value)` - Removes the option identified by the given value. - `refreshOptions(triggerDropdown)` - Refreshes the list of available options shown in the autocomplete dropdown menu. - `load(query)` - Invoked when new options should be loaded from the server. Called with the current query string. - `open()` - Shows the autocomplete dropdown containing the available options. - `close()` - Closes the autocomplete dropdown menu. - `clear(silent)` - Resets / clears all selected items from the control. If `silent` is truthy, no change event will be fired on the original input. - `clearOptions(clearFilter?)` - Removes all unselected options from the control. To clear selection options, call clear() before calling clearOptions(). - `clearFilter(option, value)` - Callback used by clearOptions() to decide whether or not an option should be removed. Return true to keep an option, false to remove ### Items - `getItem(value)` - Returns the DOM element of the item matching the given value. - `addItem(value, silent)` - "Selects" an item. Adds it to the list at the current caret position. If silent is truthy, no change event will be fired on the original input. ### Other - `getValue()` - Returns the value of the control. If multiple items can be selected with a "select" input tag (e.g. `