Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/jquesada2016/leptos-declarative
- Owner: jquesada2016
- Created: 2023-01-31T14:02:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-01T12:49:24.000Z (over 1 year ago)
- Last Synced: 2024-11-14T21:49:16.950Z (about 2 months ago)
- Language: Rust
- Size: 30.3 KB
- Stars: 16
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-leptos - leptos-declarative
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!"
};
```