@3mo/slot-controller
v0.3.8
Published
A Lit controller for slotted content that re-renders its host when it changes and tells which nodes a slot holds.
Readme
Slot Controller
A Lit controller for slotted content that re-renders its host when it changes and tells which nodes a slot holds.
Installation
npm install @3mo/slot-controllerimport { SlotController } from '@3mo/slot-controller'Examples
- Default — The card asks the controller whether its
headingandfooterslots hold anything, and renders their areas only then. - Empty Slots — With nothing slotted into
headingorfooter, neither area renders. - Changing Content — Adding or removing slotted children re-renders the host.
API
Exports
| Name | Kind | Description |
| --- | --- | --- |
| SlotController | class | A controller that re-renders its host when its slotted content changes and tells what each slot holds. |
Links
License
MIT © 3MO GmbH
