SlideShare a Scribd company logo
there be light
Ilya Gorenburg
Frontend Developer at .
Lit there be light
Lit there be light
State of frameworks
3
Projects are .
The problem
Community Forum
Web Components
Web components are a set of web
platform APIs that allow you to create
new custom, reusable, encapsulated
HTML tags to use in web pages and
web apps. Custom components and
widgets build on the Web Component
standards, will work across modern
browsers, and can be used with any
JavaScript library or framework that
works with HTML.
Source: https://www.webcomponents.org/introduction
Can I use?
Example of web component code
<script type="module" src="./motion-carousel.js"></script>
<motion-carousel id="carousel">
<img src="https://picsum.photos/seed/1/200">
<img src="https://picsum.photos/seed/2/200">
<img src="https://picsum.photos/seed/3/200">
</motion-carousel>
Define web component
How to kickstart
Vanilla JS
Frameworks*
- Stencil
- Lit
- Hybrids
- Contextful Web Components Library
- Slim.js (Outdated)
- Skate.js (Outdated)
- Polymer (Deprecated in favor of Lit)
Why Lit?
Lit there be light
Lit Stencil
Solution type Library Compiler*
Typescript ✅ ✅
Templates Declarative templates JSX
Virtual DOM ✅** ✅
Server Side Rendering ✅ ✅
Testing Jest, Karma, Mocha, Jasmine, Web
Test Runner
Jest
Localization ✅** Plug-in / Custom solutions
Tree-shaking ✅ ❌
Lit vs Stencil
Features showcase
Vite Lit TS Starter
$ yarn create vite
Project structure
webcomponent/
├─ dist/
├─ node_modules/
├─ public/
├─ src/
│ ├─ index.css
│ ├─ my_element.ts
├─ types/
├─ .gitignore
├─ tsconfig.json
├─ index.html
├─ vite.config.ts
├─ package.json
Basic Lit Component
Property bindings
Context
Localization
Runtime Transform
● Native support for expressions and HTML markup inside localized templates. No need for a
new syntax and interpolation runtime for variable substitution—just use the templates you
already have.
● Automatic re-rendering of Lit components when the locale switches.
● Only 1.27 Kb (minified + compressed) of extra JavaScript.
● XLIFF localization files.
Modes
Localization
Subcomponents
Shadow DOM
Moving CSS Out of Component
Styling the block
Web Component Inherited CSS
Most common:
● color
● cursor
● direction
● font
● font-* (font-family, font-size etc.)
● letter-spacing
● line-height
● text-align
● text-indent
● text-transform
● visibility
● word-spacing
Full list: W3.org
Integration with Angular
Or any other framework
Good to know
Using images
Any type: inline or external
Icon Fonts
Tricky, but doable
External API Requests
Just use fetch()
Localstorage
Same access as the rest of the javascript
External CSS
Yes, but not recommended by Lit team
…and
It’s just a javascript. Do what you want to do 🎉
Bundle size
Framework Time to Interactive Eager JS KiB Total KiB
Angular 1.6s 72Kb 74Kb
Lit 0.8s 16Kb 18Kb
Next 2.2s 83Kb 94Kb
Nuxt 3 1.5s 50Kb 55Kb
React 0.8s 150Kb 171Kb
Svelte 1.5s 19Kb 24Kb
Vue 3 1.2s 33Kb 41Kb
Source: https://github.com/BuilderIO/framework-benchmarks#todo-app
Resources
- Use web components for what they’re good at
https://nolanlawson.com/2023/08/23/use-web-components-for-what-theyre-good-at/
- Custom Elements Everywhere
https://custom-elements-everywhere.com/
- A curated list of awesome Web Components resources:
https://github.com/web-padawan/awesome-web-components
- All the Ways to Make a Web Component:
https://webcomponents.dev/blog/all-the-ways-to-make-a-web-component/
- Web Components Today:
https://webcomponents.today/
- Moving from Stencil to LitElement:
https://www.abeautifulsite.net/posts/moving-from-stencil-to-lit-element/
- Framework Benchmarks:
https://github.com/BuilderIO/framework-benchmarks
- A curated list of awesome Lit resources:
https://github.com/web-padawan/awesome-lit
- Building UI components in DevTools with Custom Elements:
https://goo.gle/building-ui-devtools
- Google Material Components:
https://github.com/material-components/material-web
- Handling data with Web Components
https://itnext.io/handling-data-with-web-components-9e7e4a452e6e
Thank you
Web: ilya.gorenburg.com
Twitter: @gorenburg

More Related Content

PPTX
Web component
PDF
Webcomponents are your frameworks best friend
PDF
KharkivJS: Flaws of the Web Components in 2019 and how to address them
PDF
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
PDF
Web components api + Vuejs
PDF
Frameworks and webcomponents
PDF
«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​
PDF
Front-end tower of Babylon
Web component
Webcomponents are your frameworks best friend
KharkivJS: Flaws of the Web Components in 2019 and how to address them
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Web components api + Vuejs
Frameworks and webcomponents
«Разрушаем Вавилонскую Башню WWW с помощью веб-компонент»​
Front-end tower of Babylon

Similar to Lit there be light (20)

PDF
Fullstack Web Components Complete Guide to Building UI Libraries with Web Com...
PDF
Thinking in Components
PDF
WordCamp Brighton - Why use web components
PDF
Web components and friends
PPTX
Vuejs and Web components - current state
PPTX
Web Components: The Future of Web Development is Here
PDF
Web components are the future of the web - Take advantage of new web technolo...
PPTX
Web components Introduction
PDF
Presentation About The Web Components | Selma SALTIK
PDF
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
PPTX
web_components_workshop.pptx
PPTX
Open Apereo - Web components workshop
PPTX
Web components and Package managers
PDF
Web components - An Introduction
PDF
Web component driven development
PDF
Create Web Components using Google Lit
PDF
Components vs Frameworks
PDF
Webcomponents v2
PDF
LvivCSS: Web Components as a foundation for Design System
PPTX
Web components
Fullstack Web Components Complete Guide to Building UI Libraries with Web Com...
Thinking in Components
WordCamp Brighton - Why use web components
Web components and friends
Vuejs and Web components - current state
Web Components: The Future of Web Development is Here
Web components are the future of the web - Take advantage of new web technolo...
Web components Introduction
Presentation About The Web Components | Selma SALTIK
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
web_components_workshop.pptx
Open Apereo - Web components workshop
Web components and Package managers
Web components - An Introduction
Web component driven development
Create Web Components using Google Lit
Components vs Frameworks
Webcomponents v2
LvivCSS: Web Components as a foundation for Design System
Web components
Ad

Recently uploaded (20)

PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Big Data Technologies - Introduction.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
MYSQL Presentation for SQL database connectivity
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Modernizing your data center with Dell and AMD
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
A Presentation on Artificial Intelligence
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Big Data Technologies - Introduction.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
MYSQL Presentation for SQL database connectivity
“AI and Expert System Decision Support & Business Intelligence Systems”
Modernizing your data center with Dell and AMD
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Monthly Chronicles - July 2025
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
A Presentation on Artificial Intelligence
20250228 LYD VKU AI Blended-Learning.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Ad

Lit there be light

  • 10. Web components are a set of web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use in web pages and web apps. Custom components and widgets build on the Web Component standards, will work across modern browsers, and can be used with any JavaScript library or framework that works with HTML. Source: https://www.webcomponents.org/introduction
  • 12. Example of web component code <script type="module" src="./motion-carousel.js"></script> <motion-carousel id="carousel"> <img src="https://picsum.photos/seed/1/200"> <img src="https://picsum.photos/seed/2/200"> <img src="https://picsum.photos/seed/3/200"> </motion-carousel>
  • 14. How to kickstart Vanilla JS Frameworks* - Stencil - Lit - Hybrids - Contextful Web Components Library - Slim.js (Outdated) - Skate.js (Outdated) - Polymer (Deprecated in favor of Lit)
  • 17. Lit Stencil Solution type Library Compiler* Typescript ✅ ✅ Templates Declarative templates JSX Virtual DOM ✅** ✅ Server Side Rendering ✅ ✅ Testing Jest, Karma, Mocha, Jasmine, Web Test Runner Jest Localization ✅** Plug-in / Custom solutions Tree-shaking ✅ ❌ Lit vs Stencil
  • 19. Vite Lit TS Starter $ yarn create vite
  • 20. Project structure webcomponent/ ├─ dist/ ├─ node_modules/ ├─ public/ ├─ src/ │ ├─ index.css │ ├─ my_element.ts ├─ types/ ├─ .gitignore ├─ tsconfig.json ├─ index.html ├─ vite.config.ts ├─ package.json
  • 24. Localization Runtime Transform ● Native support for expressions and HTML markup inside localized templates. No need for a new syntax and interpolation runtime for variable substitution—just use the templates you already have. ● Automatic re-rendering of Lit components when the locale switches. ● Only 1.27 Kb (minified + compressed) of extra JavaScript. ● XLIFF localization files. Modes
  • 28. Moving CSS Out of Component
  • 30. Web Component Inherited CSS Most common: ● color ● cursor ● direction ● font ● font-* (font-family, font-size etc.) ● letter-spacing ● line-height ● text-align ● text-indent ● text-transform ● visibility ● word-spacing Full list: W3.org
  • 31. Integration with Angular Or any other framework
  • 33. Using images Any type: inline or external
  • 36. Localstorage Same access as the rest of the javascript
  • 37. External CSS Yes, but not recommended by Lit team
  • 38. …and It’s just a javascript. Do what you want to do 🎉
  • 39. Bundle size Framework Time to Interactive Eager JS KiB Total KiB Angular 1.6s 72Kb 74Kb Lit 0.8s 16Kb 18Kb Next 2.2s 83Kb 94Kb Nuxt 3 1.5s 50Kb 55Kb React 0.8s 150Kb 171Kb Svelte 1.5s 19Kb 24Kb Vue 3 1.2s 33Kb 41Kb Source: https://github.com/BuilderIO/framework-benchmarks#todo-app
  • 40. Resources - Use web components for what they’re good at https://nolanlawson.com/2023/08/23/use-web-components-for-what-theyre-good-at/ - Custom Elements Everywhere https://custom-elements-everywhere.com/ - A curated list of awesome Web Components resources: https://github.com/web-padawan/awesome-web-components - All the Ways to Make a Web Component: https://webcomponents.dev/blog/all-the-ways-to-make-a-web-component/ - Web Components Today: https://webcomponents.today/ - Moving from Stencil to LitElement: https://www.abeautifulsite.net/posts/moving-from-stencil-to-lit-element/ - Framework Benchmarks: https://github.com/BuilderIO/framework-benchmarks - A curated list of awesome Lit resources: https://github.com/web-padawan/awesome-lit - Building UI components in DevTools with Custom Elements: https://goo.gle/building-ui-devtools - Google Material Components: https://github.com/material-components/material-web - Handling data with Web Components https://itnext.io/handling-data-with-web-components-9e7e4a452e6e