Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

is

Upgrades a native element into a customized built-in element that keeps its native semantics. Not supported in Safari; VB gets the same result with data-* enhancers.

Overview

The is attribute turns a native element into a customized built-in element: a class that extends that element's interface (HTMLButtonElement, HTMLInputElement…) and adds behaviour. Unlike an autonomous custom element such as <my-button>, it keeps everything the native element has: its role, keyboard handling, form participation and default styles.

Applies to: every HTML element (it is a global attribute). It only does something when a matching class has been registered with customElements.define(name, Class, { extends: 'tag' }).

Values

ValueMeaning
A valid custom element name, e.g. press-counterThe element becomes that customized built-in once a class is defined for the name with a matching extends tag. Until then it is an ordinary native element.
AbsentAn ordinary native element.

Read once. The value is taken when the element is created. Changing or removing is later does nothing. In script, create one with document.createElement('button', { is: 'press-counter' }).

Examples

Registering

Customized built-in or autonomous element

Customized built-in (is)Autonomous (<my-el>)
Markup<button is="x"><my-button>
ExtendsA specific element interfaceHTMLElement
Role, keyboard, focusInheritedAdded by you
Form participationInheritedElementInternals
Before upgrade or without supportA working native elementAn unknown inline element
SafariNot supportedSupported

In Vanilla Breeze

  • VB does not use is. Its components are autonomous custom elements, which work in every browser.
  • data-* enhancers give the same result everywhere. What customized built-ins promise (native element, extra behaviour) is how VB's data attributes work: the element stays a real <input> or <button>, and a small script adds behaviour. A phone-formatting input is <input data-mask="phone">; a copy button is <button data-copy>.
  • <card-list> never writes is from data. Like style and srcdoc, it is on the component's blocked list so a data value cannot turn an element into a different custom element (src/web-components/card-list/logic.js).

Accessibility

  • The main benefit. <button is="…"> is announced as a button, sits in the Tab order and responds to Enter and Space with no extra work.
  • The fallback is safe. Where is is unsupported, users still get the native element. Design so the page works without the added behaviour.

Browser support

Not Baseline (checked 2026-11): Chrome 67, Edge 79 and Firefox 63 support customized built-ins. Safari does not, and WebKit's standards position on the feature is "oppose" (WebKit/standards-positions#97). A polyfill exists but adds weight and complexity.

Gotchas

  • One tag per class. A class that extends HTMLButtonElement cannot be used on an <input>.
  • Server-rendered markup is fine. Before the class is defined, and in Safari, <button is="x"> is a normal button. Only the added behaviour is missing.
  • Shadow DOM is limited. Only some elements (such as article, section, div, span, p, headings) can have a shadow root; buttons and inputs cannot.

Related

  • Web components — VB's autonomous custom elements.
  • data-mask — input formatting on a native input.
  • data-copy — clipboard behaviour on a native button.
  • <button> — what a customized built-in button inherits.

Which to choose

  • data-* enhancer — extra behaviour on a native element, in every browser. VB's default.
  • Autonomous custom element — a new component with its own structure and API.
  • is — only when you can accept that Safari users get the plain native element.
↑