blikblum / wc-context

Context for Web Components
https://blikblum.github.io/wc-context/
MIT License
47 stars 8 forks source link
context lit lit-element web-components

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) with primitives for lazy loading
    ✓ Builtin context-provider and context-consumer elements
    ✓ Conforms with the Context protocol
    ✓ Full code coverage

Live example

Usage

Check the documentation https://blikblum.github.io/wc-context/

License

MIT Copyright © 2023 Luiz Américo Pereira Câmara aka blikblum