# HTML & CSS Styling

{% hint style="info" %}
These CSS classes are available on Homey Cloud, and on Homey Pro since <mark style="background-color:blue;">v8.1.0</mark>
{% endhint %}

## Header and Titles

For custom pairing screens and app settings you might want to use our default header with title and an optional subtitle.

<table><thead><tr><th width="253">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-header</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;header class="homey-header">&#x3C;/header>
</code></pre></td></tr><tr><td><code>.homey-title</code></td><td><pre class="language-html"><code class="lang-html">&#x3C;h1 class="homey-title">&#x3C;/h1>
</code></pre></td></tr><tr><td><code>.homey-subtitle</code></td><td><pre class="language-html"><code class="lang-html">&#x3C;p class="homey-subtitle">&#x3C;/p>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-da3adfff7185cca3b56093655ff1c03cbd046874%2Fheader.png?alt=media" alt=""><figcaption><p>By using the <code>homey-header</code> class you create spacing and a line between your settings and title(s).</p></figcaption></figure></div>

{% code lineNumbers="true" %}

```html
<header class="homey-header">
  <h1 class="homey-title" data-i18n="settings.title">
    <!-- This will be filled with the translated string with key 'settings.title'. -->
  </h1>
  <p class="homey-subtitle" data-i18n="settings.subtitle">
    <!-- This will be filled with the translated string with key 'settings.subtitle'. -->
  </p>
</header>
```

{% endcode %}

## Forms

Start a new form by using the `homey-form` CSS class.

<table><thead><tr><th width="253">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;form class="homey-form">&#x3C;/form>
</code></pre></td></tr></tbody></table>

#### Example

```html
<form class="homey-form">
 <!-- Your form html here -->
</form>
```

### Fieldset and legend

With `<fieldset class="homey-form-fieldset">` you can create a new fieldset in your form.\
A fieldset is useful to create larger sections in your forms. Make sure your always use a `<legend class="homey-form-legend">` to give the fieldset a title.

<table><thead><tr><th width="253">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form-fieldset</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;fieldset class="homey-form-fieldset">&#x3C;/fieldset>
</code></pre></td></tr><tr><td><code>.homey-form-legend</code></td><td><pre class="language-html"><code class="lang-html">&#x3C;legend class="homey-form-legend">&#x3C;/legend>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-bf215113406b5b62d1d6a6b449747162aac5ebb0%2Fform-legend.png?alt=media" alt=""><figcaption><p>Use a <code>homey-form-legend</code> to create headings between form elements.</p></figcaption></figure></div>

{% code lineNumbers="true" %}

```html
<fieldset class="homey-form-fieldset">
  <legend class="homey-form-legend"></legend>
  <!-- ... -->
</fieldset>
```

{% endcode %}

### Groups

Use `<div class="homey-form-group">` to create a group combining a label with an input field. Use the `homey-form-group` class to create equal vertical spacing between all inputs.

<table><thead><tr><th width="231">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form-group</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;div class="homey-form-group">&#x3C;/div>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-33955236e6d0dc26b65b0de091c155fbbf458447%2Fform-group-spacing.png?alt=media" alt=""><figcaption><p>The yellow space marks the spacing above and below each <code>.homey-form-group</code> class</p></figcaption></figure></div>

<pre class="language-html" data-line-numbers><code class="lang-html"><strong>&#x3C;div class="homey-form-group">
</strong>  &#x3C;label class="homey-form-label" for="target">label&#x3C;/label>
  &#x3C;input class="homey-form-input" id="target" type="text" value=""/>
<strong>&#x3C;/div>
</strong></code></pre>

### Basic input & label

<table><thead><tr><th width="231">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form-label</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;label class="homey-form-label" for="target">&#x3C;/label>
</code></pre></td></tr><tr><td><code>.homey-form-input</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;input class="homey-form-input" id="target" type="text" value=""/>
</code></pre></td></tr><tr><td></td><td>Can be used for the input types: <code>text</code>, <code>number</code>, <code>password</code> and <code>url</code> .</td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-03116aae62919ccae21ab091217f44872a798651%2Fform-input-label.png?alt=media" alt=""><figcaption><p>Basic label + input example</p></figcaption></figure></div>

<pre class="language-html" data-line-numbers><code class="lang-html">&#x3C;form class="homey-form">
  &#x3C;fieldset class="homey-form-fieldset">
    &#x3C;legend class="homey-form-legend">Login data&#x3C;/legend>

    &#x3C;div class="homey-form-group">
<strong>      &#x3C;label class="homey-form-label" for="username">Username&#x3C;/label>
</strong><strong>      &#x3C;input class="homey-form-input" id="username" type="text" value=""/>
</strong>    &#x3C;/div>
    &#x3C;div class="homey-form-group">
<strong>      &#x3C;label class="homey-form-label" for="password">Password&#x3C;/label>
</strong><strong>      &#x3C;input class="homey-form-input" id="password" type="password" value=""/>
</strong>    &#x3C;/div>
    &#x3C;!-- ... -->
</code></pre>

### Radio input

#### Radio set

<table><thead><tr><th width="231">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form-radio-set</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;fieldset class="homey-form-radio-set">&#x3C;/fieldset>
</code></pre></td></tr><tr><td><code>.homey-form-radio-set-title</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;legend class="homey-form-radio-set-title">&#x3C;/legend>
</code></pre></td></tr></tbody></table>

#### Radio buttons

<table><thead><tr><th width="323">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form-radio</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;label class="homey-form-radio">&#x3C;/label>
</code></pre></td></tr><tr><td><code>.homey-form-radio-input</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;input class="homey-form-radio-input">&#x3C;/input>
</code></pre></td></tr><tr><td><code>.homey-form-radio-checkmark</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;span class="homey-form-radio-checkmark">&#x3C;/span>
</code></pre></td></tr><tr><td><code>.homey-form-radio-text</code></td><td><pre class="language-html"><code class="lang-html">&#x3C;span class="homey-form-radio-text">&#x3C;/span>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-9221cce8e4dc66d74f032fffbefdb405fe187ffe%2Flegend%2Bradio-buttons.png?alt=media" alt=""><figcaption><p>Radio buttons should be grouped in fieldsets. You can use multiple levels of fieldsets with different classes.</p></figcaption></figure></div>

{% code lineNumbers="true" %}

```html
<form class="homey-form">
  <!-- ... -->
  <fieldset class="homey-form-fieldset">
    <legend class="homey-form-legend">Multiple choice questions</legend>
    
    <div class="homey-form-group">
      <fieldset class="homey-form-radio-set">
        <legend class="homey-form-radio-set-title">Group of radio buttons</legend>
    
        <label class="homey-form-radio">
          <input class="homey-form-radio-input" type="radio" name="radio-example"/>
          <span class="homey-form-radio-checkmark"></span>
          <span class="homey-form-radio-text">Radio label 1</span>
        </label>
    
        <label class="homey-form-radio">
          <input class="homey-form-radio-input" type="radio" name="radio-example"/>
          <span class="homey-form-radio-checkmark"></span>
          <span class="homey-form-radio-text">Radio label 2</span>
        </label>
    
        <label class="homey-form-radio">
          <input class="homey-form-radio-input" type="radio" name="radio-example"/>
          <span class="homey-form-radio-checkmark"></span>
          <span class="homey-form-radio-text">Radio label 3</span>
        </label>
      </fieldset>
    </div>
    <!-- ... -->
```

{% endcode %}

### Checkbox input

#### Checkbox set

<table><thead><tr><th width="350">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form-checkbox-set</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;fieldset class="homey-form-checkbox-set">&#x3C;/fieldset>
</code></pre></td></tr><tr><td><code>.homey-form-checkbox-set-title</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;legend class="homey-form-radio-checkbox-set-title">&#x3C;/legend>
</code></pre></td></tr></tbody></table>

#### Checkboxes

<table><thead><tr><th width="323">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form-checkbox</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;label class="homey-form-checkbox">&#x3C;/label>
</code></pre></td></tr><tr><td><code>.homey-form-checkbox-input</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;input class="homey-form-checkbox-input">&#x3C;/input>
</code></pre></td></tr><tr><td><code>.homey-form-checkbox-checkmark</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;span class="homey-form-checkbox-checkmark">&#x3C;/span>
</code></pre></td></tr><tr><td><code>.homey-form-checkbox-text</code></td><td><pre class="language-html"><code class="lang-html">&#x3C;span class="homey-form-checkbox-text">&#x3C;/span>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-5759097403494f5dab453adb4691941787e5576f%2Flegend%2Bcheckbox.png?alt=media" alt=""><figcaption></figcaption></figure></div>

{% code lineNumbers="true" %}

```html
<div class="homey-form-group">
  <fieldset class="homey-form-checkbox-set">
    <legend class="homey-form-checkbox-set-title">Group of checkbox buttons</legend>

    <label class="homey-form-checkbox">
      <input class="homey-form-checkbox-input" type="checkbox" name="checkbox-example"/>
      <span class="homey-form-checkbox-checkmark"></span>
      <span class="homey-form-checkbox-text">Checkbox label 1</span>
    </label>

    <label class="homey-form-checkbox">
      <input class="homey-form-checkbox-input" type="checkbox" name="checkbox-example"/>
      <span class="homey-form-checkbox-checkmark"></span>
      <span class="homey-form-checkbox-text">Checkbox label 2</span>
    </label>

    <label class="homey-form-checkbox">
      <input class="homey-form-checkbox-input" type="checkbox" name="checkbox-example"/>
      <span class="homey-form-checkbox-checkmark"></span>
      <span class="homey-form-checkbox-text">Checkbox label 3</span>
    </label>
  </fieldset>
</div>
```

{% endcode %}

### Select

<table><thead><tr><th width="246">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form-select</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;select class="homey-form-select">
  &#x3C;option value="1">Option 1&#x3C;/option>
&#x3C;/select>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-876416e004e21da6c085a7a3e6bcd5abf36f637d%2Fselect.png?alt=media" alt=""><figcaption></figcaption></figure></div>

{% code lineNumbers="true" %}

```html
<div class="homey-form-group">
  <label class="homey-form-label" for="select-example">Select your option</label>
  <select class="homey-form-select" name="select-example" id="select-example">
    <option value="1">Option 1</option>
    <option value="2">Option 2</option>
    <option value="3">Option 3</option>
  </select>
</div>
```

{% endcode %}

### Textarea

<table><thead><tr><th width="246">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-form-textarea</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;textarea class="homey-form-textarea">&#x3C;/textarea>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-24779a21ace7050435367ad2992c7fab1e6f03dc%2Ftextarea.png?alt=media" alt=""><figcaption></figcaption></figure></div>

{% code lineNumbers="true" %}

```html
<div class="homey-form-group">
  <label for="textarea-example-1" class="homey-form-label">Label for textarea</label>
  <textarea class="homey-form-textarea" name="textarea-example-1" id="textarea-example-1" rows="10"
            placeholder="type here your text"></textarea>
</div>
```

{% endcode %}

## Buttons

### Button variants

{% hint style="info" %}
**Using multiple button variants:**\
Each button class starts with `.homey-button` this you can follow up with *color variants* such as: `-primary` ,`-secondary`, `-danger`. You can further adjust the button style by adding `-full`, `-shadow`, `-small` parameters. This way you end up having a class such as `.homey-button-primary-shadow-full`.
{% endhint %}

<table><thead><tr><th width="383">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-button-primary</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-primary">&#x3C;/button>
</code></pre></td></tr><tr><td><code>.homey-button-primary-full</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-primary-full">&#x3C;/button>
</code></pre></td></tr><tr><td><code>.homey-button-primary-shadow</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-primary-shadow">&#x3C;/button>
</code></pre></td></tr><tr><td><code>.homey-button-primary-shadow-full</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-primary-shadow-full">&#x3C;/button>
</code></pre></td></tr><tr><td><code>.homey-button-transparent</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-transparent">&#x3C;/button>
</code></pre></td></tr><tr><td><p><mark style="background-color:blue;">v8.1.1</mark></p><p><code>.homey-button-secondary-shadow</code></p></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-secondary-shadow">&#x3C;/button>
</code></pre></td></tr><tr><td><p><mark style="background-color:blue;">v8.1.1</mark></p><p><code>.homey-button-danger-shadow</code></p></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-danger-shadow">&#x3C;/button>
</code></pre></td></tr><tr><td><p><mark style="background-color:blue;">v8.1.1</mark></p><p><code>.homey-button-small</code></p></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-small">&#x3C;/button>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-348edcbf84d8b771bc8f3ceac6d28ef18964aea9%2Fhomey-button-primary-full.png?alt=media" alt=""><figcaption><p><code>.homey-button-primary-full</code></p></figcaption></figure> <figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-a0f1d0ad97f486683d395e863266cbc77ff7b366%2Fsecondary-button.png?alt=media" alt=""><figcaption><p><code>.homey-button-secondary-shadow</code></p></figcaption></figure></div>

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-50fafe057f8658d04014553ade8bddf498ab9656%2Fdanger-button.png?alt=media" alt=""><figcaption><p><code>.homey-button-danger-shadow</code></p></figcaption></figure></div>

###

### Disabled state

<table><thead><tr><th width="365">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-button-</code>{<code>variant}.is-disabled</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-primary is-disabled">&#x3C;/button>
</code></pre></td></tr><tr><td><code>.homey-button-{variant}[disabled=disabled]</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-primary" disabled="disabled">&#x3C;/button>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-67f7372818e48c425064c473144a85f84543c793%2Fhomey-button-primary-full-disabled.png?alt=media" alt=""><figcaption><p><code>.homey-button-primary-full.is-disabled</code></p></figcaption></figure></div>

### Loading state

<table><thead><tr><th width="365">CSS class</th><th>HTML</th></tr></thead><tbody><tr><td><code>.homey-button-primary-{variant}.is-loading</code></td><td><pre class="language-html" data-overflow="wrap"><code class="lang-html">&#x3C;button class="homey-button-primary-full is-loading">&#x3C;/button>
</code></pre></td></tr></tbody></table>

#### Example

<div align="left"><figure><img src="https://998911913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPk9cn4V7WnnKt7fbry%2Fuploads%2Fgit-blob-bab397513cf38e91a083c759bfe932d6fddb42c0%2FLoading.gif?alt=media" alt=""><figcaption><p><code>.homey-button-primary-full.is-loading</code></p></figcaption></figure></div>

## Right-to-Left (RTL) Styling

Homey supports Right-to-Left (RTL) layouts for languages such as Arabic. RTL layout direction is handled automatically by Homey, but custom views may require additional styling to ensure the interface remains clear and consistent in RTL contexts.

When styling custom views, keep RTL in mind from the start to avoid layout issues.

### Recommended practices

Use direction-aware CSS wherever possible so your styles work in both Left-to-Right (LTR) and Right-to-Left (RTL) layouts.

For general information about RTL support and language localization, see [Internationalization](https://apps.developer.homey.app/the-basics/app/internationalization#right-to-left-rtl-and-arabic-language-support).

#### **Prefer logical properties over left/right**

Logical properties automatically adapt to the active text direction.

```css
/* Preferred */
padding-inline-start: 16px;
padding-inline-end: 16px;
margin-inline-start: 8px;

/* Avoid */
padding-left: 16px;
padding-right: 16px;
margin-left: 8px;
```

#### **Use direction-aware text alignment**

```css
text-align: start;
```

Avoid hard-coding left or right unless absolutely necessary.

#### **Use :dir(rtl)for direction-specific adjustments**

Some visuals are inherently directional and may require explicit RTL handling.

```css
.chevron:dir(rtl) {
  transform: scaleX(-1);
}
```

Common cases include:

* arrows and chevrons
* animations and transitions
* progress indicators
* absolute positioning

**Be careful with absolute positioning**

If possible, use logical positioning properties:

```css
inset-inline-start: 0;
```

Only fall back to left / right with a :dir(rtl) override when needed.
