bem-core library [](https://github.com/bem/bem-core/actions/workflows/ci.yml) [](https://github.com/bem/bem-core/releases)
February 27, 2026 · View on GitHub
Documentation on bem-core is also available at bem.info. It is also available in Russian.
What is this?
bem-core is a base library for web interface development.
It provides the minimal stack for coding client-side JavaScript and templating.
Use
Install as an npm dependency:
npm install bem-core@5
jQuery 4 is a peer dependency — install it alongside:
npm install jquery@^4.0.0
Inside
Levels
common.blocks— suited for any devices and browsersdesktop.blocks— should be used for desktop browserstouch.blocks— implement some touch-platforms specifics
Blocks
i-bem— base block with helpers for JS and HTMLstrings— helpers for JS-stringsobjects— helpers for JS-objectsfunctions— helpers for JS-functionsevents— JS-eventsuri— helpers for work with URIs and querystringstick— global timeridle— IDLE eventnext-tick— polyfill fornextTick/setTimeout(0, ...)inherit— OOP helpersjquery— jQueryclearfix— CSS clearfix trickidentify— identify JS-objectscookie— helpers for work with browser cookiesdom— helpers for work with DOMloader— loader for JS filesua— browser features detectionkeyboard— keyboard helperspage— html/head/body scaffold
Technologies
- vanilla.js + browser.js
- bemhtml
- bemtree
API
The autogenerated JSDoc API can be found on bem.info. E.g. JSDoc for i-bem is here https://en.bem.info/platform/libs/bem-core/current/desktop/i-bem/#jsdoc
Changelog
See CHANGELOG.md.
Migration
If you are upgrading from v4, see MIGRATION.md.
Development
Working copy
-
Get the source code:
git clone -b v5 git://github.com/bem/bem-core.git cd bem-core -
Install the dependencies (requires Node.js 20+):
npm install -
Run linting:
npm run lint -
Run tests:
npm test # server-side tests (node:test) npm run test:browser # browser tests (Playwright) npm run test:all # both -
Build:
npm run build # desktop + touch platforms
How to contribute
Please refer to How to contribute guide.
Supported browsers
- Google Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
License
Code and documentation copyright 2012 YANDEX LLC. Code released under the Mozilla Public License 2.0.