Skip to content
/ Turtle Public

A simple library for building user interfaces

Notifications You must be signed in to change notification settings

smtdfc/Turtle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turtle library

Build Turtle

Simple library for build UI


  • Build Turtle Execute the following command on your terminal :

       npm run build
    

    Include Turtle in your project :

    • Script
      <script src="path/dist/turtle.min.js"></script>
  • Create new app

    const app = new Turtle.createApp(document.getElementById("root"))
    app.render(`
      <h1>Hello world<\h1>
    `)
  • Create component

    const app = new Turtle.createApp(document.getElementById("root"))
    const Box = app.createComponent(class extends Turtle.TurtleComponent{
      template(){
        return this.html`
           <h1>Hello world<\h1>    
        `
      }
    })
    
    app.render(`
      <${Box}/>
    `)