StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Follow on

© 2025 StackShare. All rights reserved.

Product

  • Stacks
  • Tools
  • Feed

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  1. Stackups
  2. Application & Data
  3. Frameworks
  4. Front End Frameworks
  5. BEM vs Web Components

BEM vs Web Components

OverviewDecisionsComparisonAlternatives

Overview

BEM
BEM
Stacks118
Followers98
Votes0
Web Components
Web Components
Stacks82
Followers60
Votes0

BEM vs Web Components: What are the differences?

Introduction: When it comes to front-end development, two popular approaches to organizing and structuring code are BEM (Block Element Modifier) methodology and Web Components. Both have their own set of advantages and differences that developers need to consider when choosing the right approach for their projects.

  1. Implementation: BEM is a naming methodology that focuses on how CSS classes are named and organized in the HTML document, while Web Components are self-contained, reusable HTML elements that encapsulate their functionality. BEM relies on naming conventions, where each class name follows a specific pattern (block__element--modifier), whereas Web Components are custom elements that can be defined and reused across different projects.

  2. Scope: BEM provides a clear and predictable way to scope CSS styles to specific elements by using the naming convention, which helps prevent style conflicts in larger projects. On the other hand, Web Components have their own encapsulated styles and behavior, reducing the chances of style leakage and conflicts by isolating the component's functionality.

  3. Customizability: BEM allows for a high level of customization through the use of modifiers, which can alter the appearance or behavior of a block or element without changing the underlying structure. Web Components offer a more encapsulated approach to customization, where developers can define properties and methods that can be used to customize the component's behavior and appearance.

  4. Reusability: Both BEM and Web Components promote reusability, but in different ways. BEM focuses on reusing CSS classes and components by leveraging the naming convention, while Web Components allow developers to create custom elements that can be reused across different projects without affecting the encapsulated functionality.

  5. Interoperability: Web Components are designed to be interoperable with any front-end framework or library, making them versatile and compatible with a wide range of development environments. BEM, on the other hand, is more closely tied to the CSS structure and requires adherence to its naming conventions, which may limit its interoperability with certain frameworks.

  6. Browser Support: Web Components have broader browser support compared to BEM, as they are based on existing web standards like Custom Elements and Shadow DOM. BEM, while widely used in the industry, relies heavily on CSS naming conventions that may not be fully supported in older browsers without the use of polyfills or additional dependencies.

In Summary, BEM and Web Components differ in their implementation approach, scope, customizability, reusability, interoperability, and browser support, offering developers distinct options for structuring and organizing front-end code.

Share your Stack

Help developers discover the tools you use. Get visibility for your team's tech choices and contribute to the community's knowledge.

View Docs
CLI (Node.js)
or
Manual

Advice on BEM, Web Components

Gericke
Gericke

Jul 27, 2020

Needs adviceon.NET Core.NET CoreJavaScriptJavaScriptReactReact

Hi,

I am looking into solutions for reusable components for an existing #MVC project which is build on .NET Core. Currently some functionality is being reuses via JavaScript. I have React experience so I know I can create React components and then reference it on the MVC app. The only problem is I do not know the full extent of it as the current app uses a lot of 3rd party libraries, not sure how that will effect React components. I am currently looking into WebComponents which is also another way for creating reusable components and it is compatible with any JavaScript library based on what I have seen on the website. Also to take in consideration that it should cause a re-write of the system.

So my question is, to future-proof reusable components, which will be best React or Web Components? And which will be more reliable to use with 3rd party libraries?

49.2k views49.2k
Comments

Detailed Comparison

BEM
BEM
Web Components
Web Components

This methodology was developed at Yandex with the goals in mind that Fast development and long-lasting results for standard projects,A project involves many people,Scalable teams,Code reuse.

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.

Statistics
Stacks
118
Stacks
82
Followers
98
Followers
60
Votes
0
Votes
0

What are some alternatives to BEM, Web Components?

Bootstrap

Bootstrap

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web.

Foundation

Foundation

Foundation is the most advanced responsive front-end framework in the world. You can quickly prototype and build sites or apps that work on any kind of device with Foundation, which includes layout constructs (like a fully responsive grid), elements and best practices.

Semantic UI

Semantic UI

Semantic empowers designers and developers by creating a shared vocabulary for UI.

Materialize

Materialize

A CSS Framework based on material design.

Material Design for Angular

Material Design for Angular

Material Design is a specification for a unified system of visual, motion, and interaction design that adapts across different devices. Our goal is to deliver a lean, lightweight set of AngularJS-native UI elements that implement the material design system for use in Angular SPAs.

Material-UI

Material-UI

Material UI is a library of React UI components that implements Google's Material Design.

Blazor

Blazor

Blazor is a .NET web framework that runs in any browser. You author Blazor apps using C#/Razor and HTML.

Quasar Framework

Quasar Framework

Build responsive Single Page Apps, SSR Apps, PWAs, Hybrid Mobile Apps and Electron Apps, all using the same codebase!, powered with Vue.

Nuxt.js

Nuxt.js

Nuxt.js presets all the configuration needed to make your development of a Vue.js application enjoyable. You can use Nuxt.js for SSR, SPA, Static Generated, PWA and more.

UIkIt

UIkIt

UIkit gives you a comprehensive collection of HTML, CSS, and JS components which is simple to use, easy to customize and extendable.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase