References

Beginner-friendly references for web development, with live, editable examples.

The HTML is attribute

Global attribute Works on every element Updated
Quick answer

The HTML is attribute lets a standard element act as a customized built-in element defined with the Custom Elements API, for example <button is="fancy-button">. It is a global attribute. Note: Safari does not implement customized built-ins, so support is not universal.

Overview

Web components come in two flavors: autonomous custom elements (a brand-new tag like <my-widget>) and customized built-in elements, which extend an existing element. The is attribute powers the second kind: you register a class that extends, say, HTMLButtonElement, then write <button is="fancy-button"> to get a real button with your extra behavior.

Because the element is still a native <button>, it keeps built-in semantics and accessibility for free. The catch is support: WebKit/Safari has declined to implement customized built-ins, so you often need a polyfill or an autonomous element instead.

Values

Value
The tag name of a registered customized built-in element.

Example

Live example
<!-- Requires customElements.define('fancy-button', class extends HTMLButtonElement {…}, {extends:'button'}) -->
<button is="fancy-button">Enhanced button</button>

Best practices

  • Use it to extend a native element while keeping its built-in behavior and accessibility.
  • Register the customized built-in with customElements.define and the extends option.
  • Check browser support — customized built-ins are not supported everywhere.
  • Prefer autonomous custom elements where broad support matters.

Frequently asked questions

What does the is attribute do?
Lets a standard element behave as a registered customized built-in element.
Is the is attribute widely supported?
No. Support is inconsistent; autonomous custom elements are more broadly supported.
Is is a global attribute?
Yes — it is a global attribute, so it can be set on any standard HTML element (it is a global attribute).