https://github.com/blikblum/wc-context
Context for Web Components
https://github.com/blikblum/wc-context
context lit lit-element web-components
Last synced: about 2 months ago
JSON representation
Context for Web Components
- Host: GitHub
- URL: https://github.com/blikblum/wc-context
- Owner: blikblum
- License: mit
- Created: 2018-05-10T23:10:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-30T21:56:20.000Z (almost 2 years ago)
- Last Synced: 2025-08-04T19:26:06.684Z (2 months ago)
- Topics: context, lit, lit-element, web-components
- Language: JavaScript
- Homepage: https://blikblum.github.io/wc-context/
- Size: 3.67 MB
- Stars: 47
- Watchers: 2
- Forks: 8
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# wc-context
> A comprehensive context implementation for web components
### Features
✓ Small and fast. No Internet Explorer support
✓ Flexible ways to define context providers and consumers
✓ Ability to provide or consume one or more contexts per element
✓ Context can be provided or consumed by any HTML element
✓ Context can be identified by string or unique identifier
✓ Works with shadow dom and slotted content (handles timing issues)
✓ Easy to implement unit tests. Most of the time, same as components without context
✓ Builtin integration with LitElement
✓ Builtin ContextProvider ([Reactive Controller](https://lit.dev/docs/composition/controllers/)) with primitives for lazy loading
✓ Builtin context-provider and context-consumer elements
✓ Conforms with the [Context protocol](https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md)
✓ Full code coverage### Live example
- Lit integration: [Shadow DOM](https://codesandbox.io/p/sandbox/wc-context-example-shadow-dom-vite-nkymx3) /
### Usage
Check the documentation https://blikblum.github.io/wc-context/
### License
MIT
Copyright © 2023 Luiz Américo Pereira Câmara aka blikblum