> Markdown version of [Variants](https://vaadin.com/docs/v14/flow/styling/lumo/variants). Section index: [llms.txt](https://vaadin.com/docs/v14/flow/llms.txt)

# Lumo Variants

Lumo has global variants that you can use to quickly customize all components and built-in component variants that can be used to style individual component instances quickly.

## <a id="dark-mode"></a>Dark Mode

Dark mode is commonly used in low-light environments or during night-time.

> **Caution:** The dark variant is not supported in Internet Explorer 11. [See the issue in GitHub](https://github.com/vaadin/vaadin-lumo-styles/issues/50).

In server-side views, use the `variant` attribute of the `@Theme` annotation. See [Using Themes](https://vaadin.com/docs/v14/flow/styling/using-themes.md) for more information.

**Java** — `UsingComponentThemes.java`

```java
@Theme(value = Lumo.class, variant = Lumo.DARK)
```

In client-side views, set the `theme` attribute on the `<html>` element.

**JavaScript** — `ThemeVariants.js`

```javascript
document.documentElement.setAttribute("theme", "dark");
```

**HTML** — `ThemeVariants.html`

```html
<html theme="dark">
```

You can also use the same attribute on any element which is in the global style scope (see [Style Scopes](https://vaadin.com/docs/v14/flow/styling/style-scopes.md)).

For server-side components, you can use the [Element API](https://vaadin.com/docs/v14/flow/element-api/tutorial-properties-attributes.md) to set the attribute value. Some components offer specific API for setting theme variants.

```java
VerticalLayout dark = new VerticalLayout();
dark.getElement().setAttribute("theme", Lumo.DARK);
```

For client-side components/templates you can add the attribute directly to the HTML element.

```html
<vaadin-vertical-layout theme="dark"></vaadin-vertical-layout>
```

## <a id="compact"></a>Compact

The compact variant reduces the font size and the sizing and spacing of all components, allowing you to place more components on the screen.

The compact variant is applied by importing an additional style sheet, which sets new values for the [Typography](https://vaadin.com/docs/v14/flow/styling/lumo/typography.md) and [Sizing and Spacing](https://vaadin.com/docs/v14/flow/styling/lumo/sizing-and-spacing.md) CSS properties. You can [view the values](https://github.com/vaadin/vaadin-lumo-styles/blob/master/presets/compact.html) from the source code.

`Java`

```java
@JsModule("@vaadin/vaadin-lumo-styles/presets/compact.js")
@Theme(Lumo.class)
public class CompactApp extends Div {
}
```

`JavaScript`

```javascript
import '@vaadin/vaadin-lumo-styles/presets/compact.js';
```

## <a id="component-variants"></a>Component Variants

You can find a component’s Lumo variants from its HTML examples online, from the "Theme Variants" section.

- [Accordion Variants](https://vaadin.com/docs/v14/ds/components/accordion#theme-variants)

- [Button Variants](https://vaadin.com/docs/v14/ds/components/button#styles)

- [Checkbox](https://vaadin.com/docs/v14/ds/components/checkbox)

- [Combo Box](https://vaadin.com/docs/v14/ds/components/combo-box) (all Text Field variants apply)

- [Custom Field Variants](https://vaadin.com/docs/v14/ds/components/custom-field#size-variants)

- [CRUD](https://vaadin.com/docs/v14/ds/components/crud) (all Grid Variants apply)

- [Date Picker](https://vaadin.com/docs/v14/ds/components/date-picker) (all Text Field variants apply)

- [Details Variants](https://vaadin.com/docs/v14/ds/components/details#theme-variants)

- [Email Field](https://vaadin.com/docs/v14/ds/components/email-field) (all Text Field variants apply)

- [Grid Variants](https://vaadin.com/docs/v14/ds/components/grid#theme-variants) (including Grid Pro)

- [Menu Bar Variants](https://vaadin.com/docs/v14/ds/components/menu-bar#default-variants)

- [Number Field](https://vaadin.com/docs/v14/ds/components/number-field) (all Text Field variants apply)

- [Notification Variants](https://vaadin.com/docs/v14/ds/components/notification#theme-variants)

- [Password Field](https://vaadin.com/docs/v14/ds/components/password-field) (all Text Field variants apply)

- [Progress Bar Variants](https://vaadin.com/docs/v14/ds/components/progress-bar#theme-variants)

- [Radio Button](https://vaadin.com/docs/v14/ds/components/radio-button)

- [Rich Text Editor Variants](https://vaadin.com/docs/v14/ds/components/rich-text-editor#theme-variants)

- [Select](https://vaadin.com/docs/v14/ds/components/select) (all Text Field variants apply)

- [Split Layout Variants](https://vaadin.com/docs/v14/ds/components/split-layout#theme-variants)

- [Tabs Variants](https://vaadin.com/docs/v14/ds/components/tabs#theme-variants)

- [Text Area](https://vaadin.com/docs/v14/ds/components/text-area) (all Text Field variants apply)

- [Text Field Variants](https://vaadin.com/docs/v14/ds/components/text-field#small-variant)

- [Tree Grid](https://vaadin.com/docs/v14/ds/components/tree-grid) (all Grid variants apply)

## <a id="related-tutorials"></a>Related Tutorials

- [Toggle dark Lumo theme variant dynamically](https://vaadin.com/blog/toggle-dark-lumo-theme-variant-dynamically)

`C821C699-EFE1-47ED-873A-B9055882725A`
