If you have a great idea for a new component, here's a guide to get you started.
It may very well occur that you find yourself needing a component that FatKit doesn't currently have. The whole idea behind FatKit is that it can be extended in any way you see fit. The only caveat is to write your component in a generic enough way that others can benefit from it too.
You can download the template from code here.
The first thing you'll want to do is place this file, with a filename representing your component, in the
assets/scripts/components directory of your FatKit test install.
Please note: do not test this in your fork of FatKit as you will push unecessary files back to GitHub when you check in your component. Create a copy of FatKit, run the install and build your component from there.
In the new component file you'll need to change:
componentNamefor the camel-cased name of your component
fatkit-and your component name (where spaces become hyphens)
data-f-and your component name (where spaces become hyphens), which refers to the name of the data-attribute that will instantiate your component
Now you are ready to add the functionality to your component. Anything added to the instantiating data-attribute will automatically extend any default options you may have set. These go in the options object before the boot function.
Inside the init function you can start adding any listeners you need and functionality. Inside the functions in your component
this refers to the component object itself and you can get the element that was used to instantiate the component with
this.element. If you need to check what value the options have you can use
this.options.youroption (where youroption is the object name).
For reference see most of the other components as they almost* all have the same code layout.
I say all because some are a little more custom do to their functionality, or the way they are used.