Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 882 Bytes

20.08-slots.md

File metadata and controls

35 lines (28 loc) · 882 Bytes
layout title label permalink nav_order parent
page
Using slots to Insert Elements in Web-Components
Using slots
/usage-web-components/slots/
8
Usage

Slots

Slots are part of the native web-component. Because Lego builds native web-components, you can use the standard slots as documented.

Example:

index.html

<user-profile>
  <span>This user is in Paris</span>
<user-profile>

bricks/user-profile.html

<template>
  <h1>User profile</h1>
  <p>important information: <slot></slot></p>
</template>

Will write …<p>important information: <span>This user is in Paris</span></p>

See more advanced examples.