Features

Power Tools for Power Users

Models

Data is the ultimate truth in an app. Models provide a convenient way to encapsulate data and make it available to the system for use. Unlike raw data, models can propagate their changes so that views can update automatically.

Learn More

Views

Magical unicorns, seriously. Views make your document come alive. You can bind them to one model, then to another, render them a few times, rendered them after a designated time, change their template, or change their element..

Learn More

Mediators

These enable you to manage the flow between the view and model. Truck creates mediators for you when you bind a view to a model. But by writing your own, you can update a model as the user interacts with the view.

Learn More

Templates

Truck has two kinds of templates, markup in the DOM, or markup in a script tag. You can use custom variables that make sense for the data you're using. You can define helpers and templates can include JavaScript.

Learn More

Components

Components allow you to reuse a view in diffeent places in your app. A component supports all the features that regular views do, including events, starting index number, etc.

Learn More

Promises

Truck supports ES6 Promises. If the browser supports these, no problem. Otherwise Truck uses a polyfill. Promises provide an elegant way to avoid nested tower of doom callback structures. Truck's Fetch API uses promises by default.

Learn More

Fetch

Fetch is Ajax with a simplified interface. It has builtin support for Promises. You can create headers for more advance uses. Promise chains make processing data and handling errors easy. It includes JSONP as well.

Learn More

Router

Routing enables you to write code detached from the DOM. Truck automatically dispatches these for you and gives you with the correct data points in the route callback. Routes are used internally and do not affect the url.

Learn More

Box

Truck's Box provides local data persistence. It first tries to use IndexedDB. If there is a problem with the browser's implementation, it falls back to WebSQL or to localStorage. The data cap varies by browser.

Learn More

Dispatch

Sometimes mediators are overkill. But you need a decouped way to handle the programatic flow between two disparate components. Truck's Dispatcher lets you do this with dispatches and receivers.

Learn More

OOP

Writing consistent and reusable code in JavaScript can be tough due to the dynamic nature and its use of protypal inheritance. Truck offers tools to create mixins, object clones and modules to organize code for easier maintenance and human readability.

Learn More

Widgets

Navigation lists, select lists, editale lists, tab bars, slide out menus, switches, buttons, carousels, popups, popovers, sheets, segmented buttons, steppers, busy indicators. Lots of widgets to implement the user interactions you need.

Learn More

Gestures

Truck provides extensive support for interactions with multiple types of devices: mouse, finger, stylus. Whether it's a tap, a mouse down, a click or a swipe, Truck gives you a consistent interface for capturing these.

Learn More

DOM

Views with data binding mean you don't need to fiddle with the DOM. If you do need to, Truck provides a powerful selector engine and DOM methods that replicate everything you know and love in jQuery. It works the same way.

Learn More

Utilities

Truck provides a number of utilities to help you write better code. These include a group of unique methods to help you write oneliners with selector filters. These are similar to is and not, but return the matching elements instead of a boolean.

Learn More

Layouts

From the simple to the complex, Truck has a comprehesive layout system to build any type of layout you need. By default Truck layouts are responsive, so you don't need to worry about device sizes. You do need to make sure your content fits properly on narrower devices.

Learn More

Themes

Truck uses themes to create the look and feel of Android, iOS and Windows Phone. You create your app with one markup and one JavaScript. To support a platform is just a matter of providing the appropriate theme. Themes make your apps look great with little effort.

Learn More

Stacks

Everything in Truck started with the concept of stacks. This is an abstraction of arrays. You can use stacks to store any kind of data collection. Stacks provide a convenient and secure way of storing data for use by your app.

Learn More

Forms & Validation

If you have forms, you can use Truck's form validators to check you data as the user is filling out the form. You can also validate the form at submit. If the form passes, it will be converted into a JSON object.

Learn More

Data Formatting

Raw data, that's what you usually get when you query a database. It doesn't look pretty. Truck provides a number of help data formatters so that your data looks the way your users expect. They have options to help you meet localization needs.

Learn More

Animation

Truck has a simple an elegant animation module. This uses JavaScript to create tweening of DOM element properties using CSS3 transitions. The API allows you to quickly and intuitively create striking animations for your app.

Learn More

Hybrids

So, you made an web app with Truck. You want to deploy it to Android or iOS. Truck provides you with NPM tools to turn your app into a hybrid that you can put on each platform's app store.

Learn More

jQuery

Truck does not need jQuery. It provides everything you need to do the things jQuery does. And it does it in less code. But if jQuery is your crack, you can use it with Truck. Just load it first. Truck will only use the parts that jQuery needs.

Learn More