Skip to content

Latest commit

 

History

History
47 lines (29 loc) · 1.73 KB

File metadata and controls

47 lines (29 loc) · 1.73 KB

sFront: simple Front-end

sFront is a component-based, front-end, JavaScript library. Make templating easier.

sFront strives for easy integration, simplicity, and understandable syntax.


Inspired by React.


Installation

  1. Create a new JavaScript (.js) file which you will use for interacting with sFront
  2. Inlcude this file in your HTML (.html/.htm) file using a <script> tag
  3. Ensure that the <script> tag has the type attribute set to module (i.e. <script type="module" src="..."></script>)

Integration

In your JavaScript (.js) file, either:

  • Import all of sFront by stating:

    import * as sFront from "sFront.js";

    You can name the sFront variable whatever you want, but ensure that you point to the correct path when importing.

    OR

  • Import the desired sFront methods from the sFront file i.e.

    import { registerElement } from "sFront.js";
  • If using the sFront CDN, import from https://adampodoxin.github.io/sFront/sFront.js instead of a local file.

Examples

Examples of how to use sFront can be seen in the examples folder of the GitHub repository. The contacts list example shows the perfect way to easily use templates with sFront.