Menu
Libraries |
Category

svelte-router

  • A router component specifically designed for Svelte applications (v3.0.0+)
  • Provides client-side routing functionality with features like navigation and route matching
  • Key components:
    • SvelteRouter: Main router instance with navigation methods (push, replace, go, etc.)
    • Link: Component for creating navigational links with active state styling
  • Supports hash-based routing mode
  • Allows route configuration with path-component mapping
  • Includes active link styling through router-link-active class or customizable activeClassName
  • Example use case: Creating a simple SPA with multiple views (Home, Welcome pages)
  • Target audience: Svelte developers needing client-side routing solutions

Note: Older versions support Svelte v1.8.0+ (v2 branch) and pre-v1.8.0 (0.1.x branch).

svelterouter-componentrouter

Comments