This is a collection of examples written in Seed.
These examples also serve as a testing suite for Seed development. Changes to the Seed framework are tested against these examples to ensure there aren't unintended changes to user space.
A good first example to look at is the Counter example.
cargo-make
is required. To install it, run cargo install cargo-make
.
To run an example:
cd examples/$EXAMPLE_DIR
cargo make start
The Seed homepage, also serving as an example. Includes simple interactions, markdown elements, routing, and view markup.
How to make a basic animation with random generators.
Intended as a demo of Shipyard (Entity Component System) integration.
How to make a canvas element and use ElRef
s.
How to draw SVG charts.
How to write reusable views / components with builder pattern.
Intended as a demo of basic functionality.
How to use multiple "components".
How to create and use custom elements.
How to drag and drop simple items.
How to create a drop-zone.
How to control a DOM update using element keys and empty nodes.
How to support multiple languages in your web app based on Fluent. Includes a language selector, some sample text and FTL strings demonstrating the simplicity and power of Seed powered by Fluent's Rust crate.
How to render markdown.
How to reduce boilerplate when you have MANY similar pages. The demo is experimental and intended for experienced Rust and Seed developers.
How to create and browse multiple pages in your app.
How to create and browse multiple pages in your app. This example uses hash routing.
How to create and browse multiple pages in your app. Pages keep their state.
How to use ResizeObserver.
How to call Rust functions from Javascript.
How to create and use subscriptions, streams, notifications and commands.
How to write a component in The Elm architecture. You'll also learn how to pass messages to the parent component.
How to test your app.
How to make HTTP request using Fetch API.
How to increase render speed by Node::NoChange
.
How to record the screen using the Screen Capture API.
Classic TodoMVC example with Local Storage.
How to prevent navigating away when there are unsaved changes on the website.
How to trigger update
function from Javascript world.
You'll also see how to call JS functions from Rust.
Intended as a demo of Url functions and browser navigation.
How to show your webcam output in video
element.
A demonstration of event-handlers attached to the window
.
Backend server integration & interaction examples.
Service worker integration demo. Includes registration, asset caching, state change messaging and notification subscription.
How to implement login / logout.
Demonstrates how to register, log in and communicate with the server over an unsecured network.
How to communicate with a GraphQL backend.
Example of a workspace with Actix server.
Example of communicating with a server using WebSockets.