# topcoat | Tokio | Knowledge Base | Instagit

A batteries-included framework for building web apps

GitHub Stars: 2k

Repository: https://github.com/tokio-rs/topcoat

---

## Articles

### [How to Implement Custom Middleware and Request Handlers in Topcoat](/tokio-rs/topcoat/how-do-i-implement-custom-middleware-or-request-handlers)

Learn how to implement custom middleware and request handlers in Topcoat. Discover Topcoat's functional approach with async functions and leverage the Tower ecosystem via TowerLayer and TowerRoute.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use the `font!` Macro and Fontsource for Web Fonts in Topcoat](/tokio-rs/topcoat/how-do-i-use-the-font-macro-and-fontsource-for-web-fonts)

Learn to use the font! macro and Fontsource for web fonts in Topcoat. Effortlessly serve custom fonts with automatic router discovery and the topcoat::font::link component.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use Topcoat’s Iconify Integration for Vendoring Icons](/tokio-rs/topcoat/how-do-i-use-the-iconify-integration-for-vendoring-icons)

Learn to use Topcoat's Iconify integration to vendor icons. Enable the icon-iconify feature, stage icon sets, and embed thousands of SVG icons as compile-time constants with iconify::include! or iconify_icon!.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use Alpine AJAX Integration for Partial HTML Updates in Topcoat](/tokio-rs/topcoat/how-do-i-use-alpine-ajax-integration-for-partial-html-updates)

Learn how to use Alpine AJAX integration for partial HTML updates in Topcoat. Enable the alpine-ajax feature and efficiently update your web page fragments.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use Topcoat’s Cookie Jar API for Reading and Writing Cookies](/tokio-rs/topcoat/how-do-i-use-the-cookie-jar-api-for-reading-and-writing-cookies)

Learn to read and write cookies using Topcoat's cookie jar API. Easily get incoming cookies and add or remove outgoing ones for your web applications.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Implement File Uploads in Topcoat: Complete Multipart Handling Guide](/tokio-rs/topcoat/how-do-i-implement-file-uploads-in-topcoat)

Learn how to implement file uploads in Topcoat with this comprehensive guide. Discover Topcoat's Multipart extractor for seamless multipart form data handling.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use the #[procedure] Macro for Async Server Functions in Tokio Topcoat](/tokio-rs/topcoat/how-do-i-use-the-procedure-macro-for-async-server-functions-callable-from-client)

Learn to use the #[procedure] macro in Tokio Topcoat to easily expose async Rust functions as server endpoints callable from client applications.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use the topcoat fmt CLI to Format view! Macros](/tokio-rs/topcoat/how-do-i-use-the-topcoat-fmt-cli-to-format-view-macros)

Learn to use the topcoat fmt CLI to format view! macros. This tool reformats macro bodies with rustfmt and a custom pretty-printer for normalized HTML syntax.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use Datastar for Server-Sent Events and Reactive Updates in Topcoat](/tokio-rs/topcoat/how-do-i-use-datastar-for-server-sent-events-and-reactive-updates)

Learn to implement server-sent events and reactive updates in Topcoat with Datastar. Stream SSE to patch the DOM and merge signals for dynamic web applications. Enable the datastar Cargo feature for extractors and response types.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use htmx Integration for Partial Page Updates in Topcoat](/tokio-rs/topcoat/how-do-i-use-htmx-integration-for-partial-page-updates)

Easily implement partial page updates in Topcoat using htmx integration. Leverage request headers and response responders to swap HTML fragments without JavaScript.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Implement WebSockets in Topcoat: A Complete Guide with Examples](/tokio-rs/topcoat/how-do-i-implement-websockets-in-topcoat)

Implement WebSockets in Topcoat with this comprehensive guide. Learn how to leverage topcoat-router and the websocket feature for real-time communication in your applications. Get started today.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use the module_router! Macro for Automatic Route Discovery in Topcoat](/tokio-rs/topcoat/how-do-i-use-the-module_router-macro-for-automatic-route-discovery)

Discover automatic route discovery with Topcoat's module_router! macro. Compile routes from your Rust module hierarchy to simplify web application development.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use Signed and Encrypted Cookies in Topcoat](/tokio-rs/topcoat/how-do-i-use-signed-and-encrypted-cookies-in-topcoat)

Learn to use signed and encrypted cookies in Topcoat with the cookie! macro and SecretKey. Protect your cookie data effectively and enhance application security.

- Tags: how-to-guide
- Published: 2026-07-31

### [How Sessions and Authentication Work in Topcoat: A Developer's Guide](/tokio-rs/topcoat/how-do-sessions-and-authentication-work-in-topcoat)

Discover how Topcoat's stateless session system and authentication work. Learn about cryptographically secure tokens and SHA-256 hashes for robust CSRF protection.

- Tags: tutorial
- Published: 2026-07-31

### [How to Configure Topcoat with Tailwind CSS Integration](/tokio-rs/topcoat/how-do-i-configure-topcoat-with-tailwind-css-integration)

Learn how to configure Topcoat with Tailwind CSS integration. Topcoat bundles a Tailwind CSS CLI wrapper that compiles styles at build time, eliminating Node.js.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use the asset! Macro for Static File Bundling and Caching in Topcoat](/tokio-rs/topcoat/how-do-i-use-the-asset-macro-for-static-file-bundling-and-caching)

Learn to use the asset! macro in Topcoat for efficient static file bundling and caching. Embed files directly into your executable for content-hashed, cache-friendly assets.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Implement Server-Side Rendering with the #[shard] Attribute in Topcoat](/tokio-rs/topcoat/how-do-i-implement-server-side-rendering-with-the-shard-attribute)

Learn to implement server-side rendering with Topcoat's #[shard] attribute. Effortlessly update page fragments on reactive signal changes for dynamic HTML without full reloads.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Use Signals for Client-Side State Management in Topcoat](/tokio-rs/topcoat/how-do-i-use-signals-for-client-side-state-management-in-topcoat)

Master client-side state management in Topcoat with signals. Learn to declare, read, and mutate signals for automatic UI updates in your web applications.

- Tags: how-to-guide
- Published: 2026-07-31

### [How to Create Custom Components with the `#[component]` Macro in Topcoat](/tokio-rs/topcoat/how-do-i-create-custom-components-with-the-component-macro)

Learn to create custom components with the #[component] macro in Topcoat. Transform async functions into reusable UI components for declarative use in view! blocks. Effortlessly build your UI.

- Tags: how-to-guide
- Published: 2026-07-31

### [How Module-Based Automatic Routing Works in Topcoat: A Complete Guide](/tokio-rs/topcoat/how-does-module-based-automatic-routing-work-in-topcoat)

Discover how module-based automatic routing in Topcoat transforms your Rust module hierarchy into a type-safe URL routing table. Learn about kebab-case conversion and segment overrides.

- Tags: deep-dive
- Published: 2026-07-31

### [How to Use the view! Macro for Conditional Attributes and Control Flow in Topcoat](/tokio-rs/topcoat/how-do-i-use-the-view-macro-for-conditional-attributes-and-control-flow)

Master the Topcoat view! macro for conditional attributes and Rust control flow like if, for, and match. Write dynamic HTML templates in Rust efficiently.

- Tags: how-to-guide
- Published: 2026-07-31

### [How Topcoat Implements Client-Side Reactivity Without JavaScript Bundles](/tokio-rs/topcoat/how-does-topcoats-client-side-reactivity-work-without-javascript-bundles)

Discover how Topcoat enables client-side reactivity without JavaScript bundles by compiling Rust to JS, delivering a single runtime script for efficient DOM updates and signal management.

- Tags: internals
- Published: 2026-07-31

### [How to Implement File Uploads and Handle Multipart Form Data in Topcoat](/tokio-rs/topcoat/how-to-implement-file-uploads-and-handle-multipart-form-data-topcoat)

Learn to implement file uploads in Topcoat using the Multipart extractor. Handle multipart form data efficiently with asynchronous streaming when the multipart Cargo feature is enabled.

- Tags: how-to-guide
- Published: 2026-07-21

### [How to Use App Context for Sharing Values Across Requests in Topcoat](/tokio-rs/topcoat/how-to-use-app-context-sharing-values-topcoat)

Learn how to share values across requests in Topcoat using app context. Access global state like DB pools and configs safely in your handlers.

- Tags: how-to-guide
- Published: 2026-07-21

### [How to Implement Conditional CSS Class Lists with Topcoat's class! Macro](/tokio-rs/topcoat/how-to-implement-conditional-css-class-lists-topcoat-class-macro)

Master Topcoat's class! macro for type-safe CSS class strings. Learn conditional syntax for dynamic class lists, ensuring clean, zero-allocation output. Optimize your web components today.

- Tags: how-to-guide
- Published: 2026-07-21

### [How to Use HTMX for Partial Page Updates with Topcoat](/tokio-rs/topcoat/how-to-use-htmx-for-partial-page-updates-topcoat)

Learn to use HTMX for partial page updates with Topcoat. Effortlessly manage requests and responses for seamless updates, no manual headers needed.

- Tags: how-to-guide
- Published: 2026-07-21

### [How to Configure Tailwind CSS Integration in Topcoat: A Complete Guide](/tokio-rs/topcoat/how-to-configure-tailwind-css-integration-topcoat)

Configure Tailwind CSS with Topcoat easily. This guide shows how to use the built-in CLI wrapper, eliminating Node js and streamlining your Rust build process for automatic utility class scanning.

- Tags: how-to-guide
- Published: 2026-07-21

### [How to Handle Cookies (Including Signed and Encrypted) with Topcoat's Cookie Jar API](/tokio-rs/topcoat/how-to-handle-cookies-with-topcoat-cookie-jar-api)

Learn to handle cookies with Topcoat's Cookie Jar API. Access signed and encrypted cookies using request helpers and configure secrets for automatic security.

- Tags: how-to-guide
- Published: 2026-07-21

