<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/webapp-ui-component-series-pzewcrtjo" -->

---
title: Webapp UI Component Series | daily.dev
description: A short guide showing two approaches to writing UI components in vanilla JavaScript: using a class-based custom element (Web Components API with...
canonical: https://daily.dev/posts/webapp-ui-component-series-pzewcrtjo
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Webapp UI Component Series | daily.dev
og:description: A short guide showing two approaches to writing UI components in vanilla JavaScript: using a class-based custom element (Web Components API with...
og:url: https://daily.dev/posts/webapp-ui-component-series-pzewcrtjo
og:image: https://api.daily.dev/og/posts/pzEwCRTJo.png
og:image:alt: Webapp UI Component Series
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Webapp UI Component Series

**[Towards Dev](https://daily.dev/sources/towardsdev)** · 1 min read · 0 upvotes · 0 comments

## Summary

A short guide showing two approaches to writing UI components in vanilla JavaScript: using a class-based custom element (Web Components API with connectedCallback) versus standalone script functions that manipulate the DOM directly. Both examples build a simple styled paragraph element.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://towardsdev.com/webapp-ui-component-series-fe2402919b1c>

## Similar posts on daily.dev

- [Building a Web Component: : A Step-by-Step Guide](https://daily.dev/posts/building-a-web-component-a-step-by-step-guide-ks6l2hqlq) · Medium · 1 upvotes · 0 comments
- [Web Components: The Framework-Free Renaissance](https://daily.dev/posts/web-components-the-framework-free-renaissance-lvucvixaf) · Hacker News · 65 upvotes · 5 comments
- [Web Components Are the Comeback Nobody Saw Coming](https://daily.dev/posts/web-components-are-the-comeback-nobody-saw-coming-5oxazwtym) · The New Stack · 109 upvotes · 13 comments
- [How I Write Custom Elements with lit-html – Frontend Masters Blog](https://daily.dev/posts/how-i-write-custom-elements-with-lit-html-frontend-masters-blog-5wo9pzi23) · Frontend Masters · 3 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#javascript](https://daily.dev/tags/javascript), [#html](https://daily.dev/tags/html), [#web-components](https://daily.dev/tags/web-components)

[View this post on daily.dev](https://daily.dev/posts/webapp-ui-component-series-pzewcrtjo)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Webapp UI Component Series","url":"https://daily.dev/posts/webapp-ui-component-series-pzewcrtjo","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/webapp-ui-component-series-pzewcrtjo"},"datePublished":"2026-07-20T16:10:33.820Z","dateModified":"2026-07-20T16:10:49.878Z","description":"A short guide showing two approaches to writing UI components in vanilla JavaScript: using a class-based custom element (Web Components API with...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d6ab0a9a223ee01bc82d647f54feb2d2?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d6ab0a9a223ee01bc82d647f54feb2d2?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Towards Dev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Towards Dev","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/2c710db2750a4a70835862534cb7c9d4","url":"https://daily.dev/sources/towardsdev"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/webapp-ui-component-series-pzewcrtjo","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,javascript,html,web-components","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Towards Dev","item":"https://daily.dev/sources/towardsdev"},{"@type":"ListItem","position":3,"name":"Webapp UI Component Series"}]}
```

