sFront is a component-based, front-end, JavaScript library. Make templating easier.
sFront strives for easy integration, simplicity, and understandable syntax.
Inspired by React.
-
- Download or clone the
sFront.jsfile to your project OR - Use the sFront CDN
- Download or clone the
- Create a new
JavaScript (.js)file which you will use for interacting with sFront - Inlcude this file in your
HTML (.html/.htm)file using a<script>tag - Ensure that the
<script>tag has thetypeattribute set tomodule(i.e.<script type="module" src="..."></script>)
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.jsinstead of a local file.
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.