Created
August 27, 2024 10:14
-
-
Save leekelleher/4f05d05af695fddeef5ecd21c24a2891 to your computer and use it in GitHub Desktop.
Boilerplate for a custom Umbraco web component (Umbraco Lit Element class)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { css, customElement, html } from '@umbraco-cms/backoffice/external/lit'; | |
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; | |
import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; | |
const elementName = 'umb-custom-element'; | |
@customElement(elementName) | |
export class UmbCustomElement extends UmbLitElement { | |
constructor() { | |
super(); | |
} | |
render() { | |
return html``; | |
} | |
static styles = [UmbTextStyles, css``]; | |
} | |
export { UmbCustomElement as element }; | |
declare global { | |
interface HTMLElementTagNameMap { | |
[elementName]: UmbCustomElement; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment