Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jquesada2016/leptos-declarative

Declarative components for the leptos rust web framework.
https://github.com/jquesada2016/leptos-declarative

Last synced: about 1 month ago
JSON representation

Declarative components for the leptos rust web framework.

Awesome Lists containing this project

README

        

# leptos_declarative

Declarative components to represent control-flow and other useful
constructs in the [`leptos`] web framework not directly
provided by default.

This crate provides 2 main components

- `If`
- `Portal`

# Usage

For more usage examples, please refer to the respective
components' documentation, but here's a taste.

## If

```rust
use leptos::*;
use leptos_declarative::prelude::*;

let (a, _) = create_signal(cx, true);
let (b, _) = create_signal(cx, false);

view! { cx,

"A is true!"
"B is true!"
"Both A and B are false!"

};
```

## Portal

```rust
use leptos::*;
use leptos_declarative::prelude::*;

struct PortalId;

view! { cx,


"Portal goes here!"





"I went through the portal!"




};
```