Skip to content

lullaby6/ly-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 

Repository files navigation

Ly Component

Table of Contents

Installation

<script src="https://cdn.jsdelivr.net/gh/lullaby6/ly-component/cdn.js" defer></script>

Basic Usage

The components are basically html files that you can call from the ly-component element with the src attribute.

for example we have this file in the path /components/MyComponent.html:

<div>
    <h1>My Component</h1>
</div>

and in our html we would use the ly-component element and we would indicate the path through the src attribute:

<ly-component src="/components/MyComponent.html"/>

Props

To set the properties of the components, do it through the attributes and you can get the property/attribute using {<attribute name>} in your component

For example:

<ly-component src="/components/Title.html" title="Game of Thrones"/>

Title component:

<h1>{title}</h1>