Skip to content

Commit a92afe2

Browse files
authored
Blog 2026.5 frontend updates (#3077)
1 parent aa81366 commit a92afe2

2 files changed

Lines changed: 193 additions & 0 deletions

File tree

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
author: Wendelin Peleska
3+
authorURL: https://github.com/wendevlin
4+
title: "Frontend component updates in 2026.5"
5+
---
6+
7+
## Component updates
8+
9+
### ha-progress-bar
10+
11+
A new component replaces `mwc-progress-bar` in our codebase and is fully themeable. Check out this [PR](https://github.com/home-assistant/frontend/pull/51489) for a fully custom progress bar.
12+
13+
New component specific tokens:
14+
15+
```css
16+
--ha-progress-bar-indicator-color
17+
--ha-progress-bar-indicator-background
18+
--ha-progress-bar-track-color
19+
--ha-progress-bar-track-height
20+
--ha-progress-bar-border-radius
21+
--ha-progress-bar-animation-duration
22+
--ha-progress-bar-indicator-highlight-image
23+
--ha-progress-bar-indicator-highlight-width
24+
--ha-progress-bar-indicator-highlight-height
25+
```
26+
27+
### ha-switch
28+
29+
`ha-switch` was migrated to webawesome. It now has many CSS properties to make customization easier. We also removed some tokens from the old switch:
30+
31+
Removed tokens:
32+
33+
```css
34+
--switch-unchecked-button-color
35+
--switch-unchecked-track-color
36+
--switch-unchecked-color
37+
--switch-checked-button-color
38+
--switch-checked-track-color
39+
--switch-checked-color
40+
```
41+
42+
New component specific tokens:
43+
44+
```css
45+
--ha-switch-size
46+
--ha-switch-thumb-size
47+
--ha-switch-width
48+
--ha-switch-background-color
49+
--ha-switch-thumb-background-color
50+
--ha-switch-background-color-hover
51+
--ha-switch-thumb-background-color-hover
52+
--ha-switch-checked-background-color
53+
--ha-switch-checked-thumb-background-color
54+
--ha-switch-checked-background-color-hover
55+
--ha-switch-checked-thumb-background-color-hover
56+
--ha-switch-border-color
57+
--ha-switch-thumb-border-color
58+
--ha-switch-thumb-border-color-hover
59+
--ha-switch-checked-border-color
60+
--ha-switch-checked-thumb-border-color
61+
--ha-switch-checked-border-color-hover
62+
--ha-switch-checked-thumb-border-color-hover
63+
--ha-switch-thumb-box-shadow
64+
--ha-switch-disabled-opacity
65+
--ha-switch-required-marker
66+
--ha-switch-required-marker-offset
67+
```
68+
69+
### ha-checkbox
70+
71+
`ha-checkbox` was also migrated to webawesome and got new CSS properties. You can no longer use MDC tokens for it, but we added a set of tokens to customize the new checkbox.
72+
73+
New component specific tokens:
74+
75+
```css
76+
--ha-checkbox-size
77+
--ha-checkbox-border-color
78+
--ha-checkbox-border-color-hover
79+
--ha-checkbox-background-color
80+
--ha-checkbox-background-color-hover
81+
--ha-checkbox-checked-background-color
82+
--ha-checkbox-checked-background-color-hover
83+
--ha-checkbox-checked-icon-color
84+
--ha-checkbox-checked-icon-scale
85+
--ha-checkbox-border-radius
86+
--ha-checkbox-border-width
87+
--ha-checkbox-required-marker
88+
--ha-checkbox-required-marker-offset
89+
```
90+
91+
### ha-textarea
92+
93+
`ha-textarea` was migrated to webawesome and got new CSS properties. You can no longer use MDC tokens for it, but we added a set of tokens to customize the new textarea.
94+
95+
The API changed slightly. To make your textarea grow in size, set the `resize` prop to `auto`.
96+
97+
### ha-adaptive-popover
98+
99+
You might already know the (fairly new) `ha-adaptive-dialog` component. It combines a dialog and bottom sheet by showing a dialog on desktop and a bottom sheet on mobile.
100+
We added `ha-adaptive-popover` as the popover counterpart to the adaptive dialog. It shows a popover on desktop and a bottom sheet on mobile. It is based on `ha-adaptive-dialog` and is currently used in the tile card date picker feature.
101+
102+
### Removed ha-fab
103+
104+
`ha-fab` was removed, we use just a normal `ha-button` now, since the position styling was always done from the parent component.
105+
106+
## Style updates
107+
108+
### Box shadow tokens
109+
110+
We added new global box shadow tokens: `--ha-box-shadow-s`, `--ha-box-shadow-m`, `--ha-box-shadow-l`
111+
112+
But we also removed the old box shadow tokens:
113+
114+
```css
115+
--ha-color-shadow-light
116+
--ha-color-shadow-dark
117+
--ha-shadow-offset-x-...
118+
--ha-shadow-blur-...
119+
--ha-shadow-spread-..
120+
```
121+
122+
123+
### Surface colors
124+
125+
In the next release we plan to change the way we handle surface background colors. The tokens are introduced now but are just used for ha-tooltip.
126+
127+
New tokens:
128+
129+
```css
130+
--ha-color-surface-default
131+
--ha-color-surface-low
132+
--ha-color-surface-lower
133+
--ha-color-surface-default-inverted
134+
--ha-color-surface-low-inverted
135+
--ha-color-surface-lower-inverted
136+
```
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
author: Wendelin Peleska
3+
authorURL: https://github.com/wendevlin
4+
title: "Frontend context groups, new context decorators and deprecated contexts"
5+
---
6+
7+
Last release we introduced the lazy context and we wanted to use hass context and lazy context more in favor of passing the hass object.
8+
We found that small tasks often required subscribing to many contexts, so we grouped Hass contexts into logical groups.
9+
10+
## Context groups
11+
12+
Following context groups have been added:
13+
14+
- registriesContext: contains all registries (device, entity, area, etc)
15+
- internationalizationContext: contains all internationalization related data (locale, localize, etc)
16+
- apiContext: contains all API related methods (callService, callWS, etc)
17+
- connectionContext: contains all connection related data (connection, connected, hassUrl, etc)
18+
- uiContext: contains all UI related data (themes, panels, dockedSidebar, etc)
19+
- configContext: contains all config related data (auth, config, user, etc)
20+
21+
## Consume context entry decorators
22+
23+
In the last [blogpost](/blog/2026/03/25/frontend-lazy-context) I showed how to use context with `@transform`. `@transform` is powerful, but sometimes you only need a single context entry and do not want to define a transform function.
24+
To support that, we added decorators that consume a single context entry directly.
25+
You pass an array that defines where the entity ID comes from (usually a config property), and the decorator consumes the correct context and maps the entity ID to the correct registry entry.
26+
It also watches the defined path and updates the entry when needed.
27+
28+
New decorators:
29+
30+
- @consumeEntityState
31+
- @consumeEntityStates
32+
- @consumeEntityRegistryEntry
33+
34+
sample usage:
35+
36+
```ts
37+
@state()
38+
@consumeEntityRegistryEntry({ entityIdPath: ["_config", "entity"] })
39+
_entity?: EntityRegistryDisplayEntry;
40+
```
41+
42+
We may add more of these decorators in the future, e.g. for areas, devices, etc.
43+
44+
## Deprecate contexts
45+
46+
These contexts are still available, but they can be removed in a future release. Use the new context groups instead.
47+
48+
- connectionSingleContext
49+
- localizeContext
50+
- localeContext
51+
- configSingleContext
52+
- themesContext
53+
- selectedThemeContext
54+
- userContext
55+
- userDataContext
56+
- panelsContext
57+
- authContext

0 commit comments

Comments
 (0)