### Basic Riot.js application structure Source: https://riot.js.org/documentation/index Example of a minimal Riot.js application setup, including an HTML file to mount the application and a Riot component file. ```html Riot App
``` -------------------------------- ### Riot.js Mount Method Examples Source: https://riot.js.org/documentation/index Provides examples of using the riot.mount method to mount components. This includes mounting a component by its specific ID, and mounting multiple components by listing their tag names separated by commas. ```javascript // mount an element with a specific id riot.mount('#my-element') // mount selected elements riot.mount('todo, forum, comments') ``` -------------------------------- ### Install Riot.js with npm or yarn Source: https://riot.js.org/documentation/index Instructions for installing the Riot.js library using either npm or yarn package managers. These commands add Riot.js as a project dependency. ```bash npm i riot ``` ```bash yarn add riot ``` -------------------------------- ### Riot Plugin Installation Source: https://riot.js.org/documentation/index Shows how to extend Riot.js components using plugins. The `riot.install` method allows registering a function that will be executed for each component, enabling API enhancements like adding unique identifiers. ```javascript // riot-observable.js let id = 0 riot.install(function(component) { // all components will pass through here component.uid = id++ }) ``` -------------------------------- ### Riot.js Todo List component example Source: https://riot.js.org/documentation/index An extended Riot.js component demonstrating features like state management, event handling, and conditional rendering for a todo list. ```riot

{ props.title }

``` -------------------------------- ### Creating Pure Components in Riot.js Source: https://riot.js.org/documentation/index Introduces `riot.pure` for creating components that bypass Riot.js's internal rendering logic, giving developers full control. The example shows a pure component with `mount`, `update`, and `unmount` lifecycle methods. ```riot ``` -------------------------------- ### Riot.js component with pre-processor Source: https://riot.js.org/documentation/index Example of a Riot.js component using a pre-processor, specifically CoffeeScript, for its logic. The `type` attribute on the script tag specifies the pre-processor. ```riot ``` -------------------------------- ### Using Native Event Listener Options in Riot.js Source: https://riot.js.org/documentation/index This example demonstrates how to pass native event listener options, such as `{ passive: true }`, to Riot.js event handlers. Instead of a single callback function, an array is provided, where the first element is the handler and subsequent elements are options. ```riot
``` -------------------------------- ### Dynamic Event Handler Binding in Riot.js Source: https://riot.js.org/documentation/index This example shows how to dynamically bind event handlers in Riot.js using ternary operators or property access. This allows for conditional execution of different functions or calling functions stored as component properties. ```riot
``` -------------------------------- ### Riot Text Attribute Rendering Source: https://riot.js.org/documentation/index Explains how Riot.js renders text, boolean, and number expression values for HTML attributes. It shows examples of valid renderings and how `null`, `undefined`, or non-renderable values are skipped. ```riot

  • ``` -------------------------------- ### Riot Component Using Plugin Data Source: https://riot.js.org/documentation/index A Riot.js component demonstrating the use of data added by a plugin. In this example, the `uid` property, added by the `riot-observable.js` plugin, is displayed within the component's template. ```riot

    { uid }

    ``` -------------------------------- ### Conditional Fragments with '