mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-24 01:09:21 -05:00
31 lines
540 B
Markdown
31 lines
540 B
Markdown
|
# Get Started
|
||
|
|
||
|
## Installation
|
||
|
|
||
|
```shell
|
||
|
cargo add leptos-use
|
||
|
```
|
||
|
|
||
|
## Examples
|
||
|
|
||
|
- [Examples Directory](https://github.com/Synphonyte/leptos-use/tree/master/examples)
|
||
|
|
||
|
## 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.
|