Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 673 Bytes

web-component.md

File metadata and controls

20 lines (16 loc) · 673 Bytes

Web components

Vomit provides a partial implementation of HTML5 Web component and custom elements. All with the ease of simple function call:

var carousel = vomit`
  <section>
    <h2>Carousel</h2>
    <content query=".slide"/>
  </section>
`

vomit(carousel, vomit`
  <div class="slide">
    This is a slide.
  </div>
`)

When using Vomit, you can define how composition works with your component using the tag . This creates an insertion point in the presentation of your component, and the insertion point cherry-picks content to present. This is a way to create flexible components by separating content and presentation into multiple functions.