be-deslotted
TypeScript icon, indicating that this package has built-in type declarations

0.0.44 • Public • Published

be-deslotted

Transfer values from light children to host.

Actions Status How big is this package in your project?

<my-custom-element>
    #shadow
        <slot name=link be-deslotted=href></slot>
    <a slot=link href=https://cnn.com>This is CNN</a>
</my-custom-element>

my-custom-element's href property gets set to https://cnn.com.

If the name of the host property doesn't match the name of the light child property that needs passing, this can be managed via the propMap setting. [TODO]: Show example.

Viewing Locally

  1. Install git.
  2. Fork/clone this repo.
  3. Install node.
  4. Open command window to folder where you cloned this repo.
  5. npm install

  6. npm run serve

  7. Open http://localhost:3030/demo/dev in a modern browser.

Importing in ES Modules:

import 'be-exportable/be-deslotted.js';

Using from CDN:

<script type=module crossorigin=anonymous>
    import 'https://esm.run/be-deslotted';
</script>

Package Sidebar

Install

npm i be-deslotted

Weekly Downloads

45

Version

0.0.44

License

MIT

Unpacked Size

11 kB

Total Files

11

Last publish

Collaborators

  • bahrus