Basic usage
You will use any combination of HTML attributes, CSS classnames and JavaScript interfaces to deal with the different components.
Most components are used simply by adding the data-ts
attribute to elements. The framework will recognize this attribute and add behavior and styling.
Config attributes
Additional attributes may be used to configure the component. By convention, these will be prefixed with data-ts.
(including the dot). The data-ts.open
attribute would for example open the aside.
JS interface
The component may also expose a JavaScript API. For example, the Aside
can be opened with a method call instead of an attribute. You can get hold of the implementation using ts.ui.get
, which takes an element as argument.
API-only components
Components that embody more complex behavior will usually be dealt with through a pure JavaScript API, so without writing markup. This will come in handy when we decide to change the complex behavior at a later stage.
When making apps with UI components, there’s a few basic rules we would like you to observe.