leptos-use/docs/book/src/getting_started/get_started.md

31 lines
538 B
Markdown
Raw Normal View History

2023-05-15 01:52:02 +01:00
# Get Started
## Installation
```shell
cargo add leptos-use
```
## Examples
2023-05-27 03:00:08 +01:00
- [Examples Directory](https://github.com/Synphonyte/leptos-use/tree/main/examples)
2023-05-15 01:52:02 +01:00
## Usage Example
Simply import the functions you need from `leptos-use`
```rust,noplayground
# use leptos::*;
use leptos_use::use_mouse::*;
#[component]
pub fn Demo(cx: Scope) -> into ImplView {
let UseMouseReturn { x, y, .. } = use_mouse(cx);
view! { cx,
{x} "x" {y}
}
}
```
Please refer to the [functions list](functions.md) for more details.