DEV Community

loading...

Businesses & Web Components

leeaurila profile image Deep Dive Tech ・2 min read

WHAT ARE WEB COMPONENTS?

Web Components is a suite of different technologies allowing you to create reusable custom elements with their functionality encapsulated away from the rest of your code which will be utilized in your web components.

BORING -- THAT'S ALL THIS IS?

Slow down their young developer, there is more to learn! Web Components solve problems as well as developing code. The last thing you want to happen is reusing code and making your page a mess could lead to a disaster.

That is why Web Components consist of three main technologies. These can be used together to create versatile custom elements with encapsulated funcitonality that can be reused where you like without the fear of code collisions. Here are the main technologies...

  1. Custom elements: A set fo JavaScript API's that allow you to define custom elements and their behavior, which can then be used as desired in your user interface.
  2. Shadow DOM: A set o Javascript APIs for attaching an encapsulated "shadow" DOM tree to an element, which is rendered separately from the main document DOM and also control the associated functionality. This will then keep an element's features private so they can be scripted and styled with the fear of collision with other parts of the document.
  3. HTML Templates: The and elements enable you to write markup templates that are not displayed in the rendered page. These can then be reused multiple times as the basis of a custom element's structure.

DOES WEB COMPONENTS IMPROVE ACCESSIBILITY? OF COURSE!!
As we have already answered -- yes, Web Components can certainly improve accessibility. When a business has Web Components, they have a free range what they can do to improve their website for the most sufficient usability all customers can access. This will give businesses the ability to design their website any way they feel without running into big problems.

COMPANIES THAT ARE USING THIS
There are a HANDFUL of companies using web components. Why not right? Using Web Components is commonly used and with good reason why it helps their websites so much. Companies that I have discovered that use Web Components are sites such as YouTube, FootLocker, Nike, and a lot of college website as well!

YouTube Video:
https://youtu.be/sEmSVMVYVM8

Discussion (0)

Forem Open with the Forem app