leptos/examples
2024-04-05 14:55:31 -04:00
..
action-form-error-handling clean up examples 2024-01-19 15:14:39 -05:00
animated_show stable examples change (#2497) 2024-04-04 20:11:28 -07:00
cargo-make chore: bump nightly version in examples (#2479) 2024-04-01 15:16:53 -04:00
counter stable examples change (#2497) 2024-04-04 20:11:28 -07:00
counter_isomorphic stable examples change (#2497) 2024-04-04 20:11:28 -07:00
counter_url_query ex: counter_url_query; to stable (#2499) 2024-04-04 20:09:55 -07:00
counter_without_macros chore: bump nightly version in examples (#2479) 2024-04-01 15:16:53 -04:00
counters stable examples change (#2497) 2024-04-04 20:11:28 -07:00
directives stable examples change (#2497) 2024-04-04 20:11:28 -07:00
error_boundary ci(examples/error-boundary): use stable syntax (#2496) 2024-04-04 20:08:50 -07:00
errors_axum stable examples change (#2497) 2024-04-04 20:11:28 -07:00
fetch stable examples change (#2497) 2024-04-04 20:11:28 -07:00
gtk stable examples change (#2497) 2024-04-04 20:11:28 -07:00
hackernews chore(ci): move example CI over to stable (#2502) 2024-04-05 14:55:31 -04:00
hackernews_axum stable examples change (#2497) 2024-04-04 20:11:28 -07:00
hackernews_islands_axum stable examples change (#2497) 2024-04-04 20:11:28 -07:00
hackernews_js_fetch stable examples change (#2497) 2024-04-04 20:11:28 -07:00
js-framework-benchmark stable examples change (#2497) 2024-04-04 20:11:28 -07:00
login_with_token_csr_only stable examples change (#2497) 2024-04-04 20:11:28 -07:00
parent_child stable examples change (#2497) 2024-04-04 20:11:28 -07:00
portal stable examples change (#2497) 2024-04-04 20:11:28 -07:00
router stable examples change (#2497) 2024-04-04 20:11:28 -07:00
server_fns_axum stable examples change (#2497) 2024-04-04 20:11:28 -07:00
session_auth_axum stable examples change (#2497) 2024-04-04 20:11:28 -07:00
slots stable examples change (#2497) 2024-04-04 20:11:28 -07:00
spread chore(ci): move example CI over to stable (#2502) 2024-04-05 14:55:31 -04:00
sso_auth_axum chore: bump nightly version in examples (#2479) 2024-04-01 15:16:53 -04:00
ssr_modes stable examples change (#2497) 2024-04-04 20:11:28 -07:00
ssr_modes_axum stable examples change (#2497) 2024-04-04 20:11:28 -07:00
suspense_tests fix(ci): leptos examples fail with bindgen schema error (#2428) 2024-03-13 22:33:54 -04:00
tailwind_actix stable examples change (#2497) 2024-04-04 20:11:28 -07:00
tailwind_axum stable examples change (#2497) 2024-04-04 20:11:28 -07:00
tailwind_csr stable examples change (#2497) 2024-04-04 20:11:28 -07:00
timer stable examples change (#2497) 2024-04-04 20:11:28 -07:00
todo_app_sqlite stable examples change (#2497) 2024-04-04 20:11:28 -07:00
todo_app_sqlite_axum stable todo_app_sqlite_axum example (#2493) 2024-04-04 20:12:45 -07:00
todo_app_sqlite_csr stable examples change (#2497) 2024-04-04 20:11:28 -07:00
todomvc stable todomvc example (#2489) 2024-04-02 13:38:07 -07:00
Makefile.toml feat: allow spreading of both attributes and event handlers (#2432) 2024-04-05 14:30:34 -04:00
README.md feat: allow spreading of both attributes and event handlers (#2432) 2024-04-05 14:30:34 -04:00
SSR_NOTES.md doc(examples): reference run instructions (#1705) 2023-09-13 19:57:50 -04:00

Examples README

Main Branch

The examples in this directory are all built and tested against the current main branch.

To the extent that new features have been released or breaking changes have been made since the previous release, the examples are compatible with the main branch and not the current release.

Getting Started

The simplest way to get started with any example is to use the “quick start” command found in the README for each example. Most of the examples use either trunk (a simple build system and dev server for client-side-rendered apps) or cargo-leptos (a build system for server-rendered and client-hydrated apps).

Using Cargo Make

You can also run any of the examples using cargo-make. Note that this is completely optional. We use it for CI, and it can be convenient for running the examples, but is not required.

Follow these steps to get any example up and running.

  1. cd to the example you want to run
  2. Make sure cargo-make is installed (for example by running cargo install cargo-make)
  3. Make sure rustup target add wasm32-unknown-unknown was executed for the currently selected toolchain.
  4. Run cargo make ci to setup and test the example
  5. Run cargo make start to run the example
  6. Open the client URL in the console output (http://127.0.0.1:8080 or http://127.0.0.1:3000 by default)
  7. Run cargo make stop to end any processes started by cargo make start.

Here are a few additional notes:

  • Extendable custom task files are located in the cargo-make directory
  • Running a task will automatically install cargo dependencies
  • Each Makefile.toml file must extend the cargo-make/main.toml file
  • cargo-make files that end in *-test.toml configure web testing strategies
  • Run cargo make test-report to learn which examples have web tests

Prerequisites

Example projects depend on the following tools. Please install them as needed.

  • Rust
  • Nightly Rust
    • Run rustup toolchain install nightly
    • Run rustup target add wasm32-unknown-unknown
  • Cargo Make
    • Run cargo install --force cargo-make
    • Setup a command alias like alias cm='cargo make' to reduce typing (Optional)
  • Trunk
    • Run cargo install trunk
  • Node Version Manager (Optional)
  • Node.js
  • pnpm (Optional)