Skip to content

Commit facb509

Browse files
authored
docs: complete readme (#38)
1 parent 91ebe71 commit facb509

File tree

5 files changed

+52
-6
lines changed

5 files changed

+52
-6
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
<div align="center">
2+
3+
<img src="./docs/public/logo.svg" alt="" height="128px">
4+
15
# sv-router
26

3-
https://www.npmjs.com/package/sv-router
7+
[![npm](https://badgen.net/npm/v/sv-router)](https://www.npmjs.com/package/sv-router)
8+
[![install size](https://packagephobia.com/badge?p=sv-router)](https://packagephobia.com/result?p=sv-router)
9+
10+
A feature-rich yet intuitive routing library for Svelte single-page apps.
11+
12+
[Documentation](https://sv-router.vercel.app/)[Getting Started](https://sv-router.vercel.app/guide/getting-started)[Reference](https://sv-router.vercel.app/reference)
13+
14+
</div>
15+
16+
---
17+
18+
## Features
19+
20+
- 🔒 **Typesafe navigation**: Get autocomplete and type checking for your routes.
21+
- 🗂️ **File-based routing (optional)**: Enjoy the DX of a meta-framework-like approach.
22+
- 🌿 **Nested routes**: Create complex layouts with ease.
23+
-**Performance**: Optimized for speed with built-in code splitting and preloading.
24+
- 🧩 **Familiar API**: Follows established conventions from popular meta frameworks
25+
- 🚀 **Made for Svelte 5**: Benefit from faster performance and smaller bundle size.
26+
27+
## Installation
28+
29+
Add it to an existing Svelte project:
30+
31+
```bash
32+
npm install sv-router
33+
```
34+
35+
## License
36+
37+
[MIT](./LICENSE) © Colin Lienard

docs/guide/common/active-route.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ When applied to an anchor tag, this action automatically adds a CSS class when t
1919

2020
## Programmatically
2121

22-
For more complex scenarios, check if a route is active using the `isActive` function:
22+
For more complex scenarios, check if a route is active using the `isActive` function, which provides auto-complete and type checking for your routes:
2323

2424
::: code-group
2525

docs/guide/common/navigation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Similar to SvelteKit, standard anchor tags provide basic navigation between page
88
<a href="/about">About</a>
99
```
1010

11-
For enhanced type safety, use the `p` function:
11+
To leverage type-safe navigation, use the `p` function, which provides auto-complete and type checking for your routes.
1212

1313
::: code-group
1414

@@ -44,7 +44,7 @@ You can also pass parameters and additional options:
4444

4545
## Programmatic Navigation
4646

47-
For navigation triggered by JavaScript events, use the `navigate` function:
47+
For navigation triggered by JavaScript events, use the `navigate` function, which also provides auto-complete and type checking for your routes:
4848

4949
::: code-group
5050

@@ -53,15 +53,15 @@ For navigation triggered by JavaScript events, use the `navigate` function:
5353
import { navigate } from '../router';
5454
</script>
5555
56-
<button on:click={() => navigate('/about')}>About</button>
56+
<button onclick={() => navigate('/about')}>About</button>
5757
```
5858

5959
```svelte [File-based]
6060
<script lang="ts">
6161
import { navigate } from 'sv-router/generated';
6262
</script>
6363
64-
<button on:click={() => navigate('/about')}>About</button>
64+
<button onclick={() => navigate('/about')}>About</button>
6565
```
6666

6767
:::

docs/guide/getting-started.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ yarn add sv-router
2525
bun add sv-router
2626
```
2727

28+
```sh [deno]
29+
deno add npm:sv-router
30+
```
31+
2832
:::
2933

3034
## Setup

docs/guide/why.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ sv-router is a feature-rich yet intuitive routing library for Svelte SPAs. It pr
1212
- **🔌 No Backend Required**: Works perfectly for purely client-side SPAs
1313

1414
Whether you're building a small project or a complex application, sv-router provides the tools you need without the overhead of a full-stack framework.
15+
16+
## Acknowledgements
17+
18+
sv-router draws inspiration from:
19+
20+
- [TanStack Router](https://tanstack.com/router/latest)
21+
- [Vue Router](https://router.vuejs.org/)
22+
- [Solid Router](https://docs.solidjs.com/solid-router)

0 commit comments

Comments
 (0)