Skip to content

Commit fe827c2

Browse files
Update documentation
1 parent 04168f7 commit fe827c2

12 files changed

Lines changed: 119 additions & 17 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,9 @@ The logo is a combination of the [Floating UI logo](https://github.com/floating-
5656
## License
5757

5858
This project is available under the [MIT license](LICENSE.md).
59+
60+
## Rust For Web
61+
62+
The Rust Floating UI project is part of the [Rust For Web](https://github.com/RustForWeb).
63+
64+
[Rust For Web](https://github.com/RustForWeb) creates and ports web UI libraries for Rust. All projects are free and open source.

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Summary
22

33
- [Introduction](./introduction.md)
4+
- [Examples](./examples.md)
45
- [Compute Position](./compute-position.md)
56
- [Auto Update](./auto-update.md)
67
- [Middleware](./middleware/README.md)

book/src/compute-position.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ use floating_ui_dom::compute_position;
3535

3636
</div>
3737

38+
{{#endtab }}
39+
{{#tab name="Yew" }}
40+
41+
<div class="warning">
42+
43+
**Non-framework API**
44+
45+
[`use_floating()`](./frameworks/yew.md) should be used instead with a framework. If you are using a base package, change the package with the package switcher above.
46+
47+
</div>
48+
3849
{{#endtab }}
3950
{{#endtabs }}
4051

@@ -193,6 +204,17 @@ cleanup();
193204

194205
</div>
195206

207+
{{#endtab }}
208+
{{#tab name="Yew" }}
209+
210+
<div class="warning">
211+
212+
**Non-framework API**
213+
214+
[`use_floating()`](./frameworks/yew.md) should be used instead with a framework. If you are using a base package, change the package with the package switcher above.
215+
216+
</div>
217+
196218
{{#endtab }}
197219
{{#endtabs }}
198220

book/src/examples.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Examples
2+
3+
## Smart Anchor Positioning
4+
5+
Anchor a floating element next to another element while making sure it stays in view by **avoiding collisions**. This lets you position tooltips, popovers, or dropdowns optimally.
6+
7+
```toml,trunk
8+
package = "floating-ui-book"
9+
features = ["arrow", "flip", "placement", "shift", "size", "virtual"]
10+
```

book/src/frameworks/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Frameworks
22

3-
- [DOM](./dom.md)
3+
Rust Floating UI is available for the following frameworks:
4+
5+
- [DOM (`web-sys`)](./dom.md)
46
- [Leptos](./leptos.md)
57
- [Yew](./yew.md)

book/src/frameworks/dom.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
# DOM
22

3+
This package provides [DOM (`web-sys`)](https://rustwasm.github.io/wasm-bindgen/web-sys/index.html) bindings for `floating-ui-core` - a library that provides anchor positioning for a floating element to position it next to a given reference element.
4+
5+
## Installation
6+
7+
```shell
8+
cargo add floating-ui-dom
9+
```
10+
11+
- [View on crates.io](https://crates.io/crates/floating-ui-dom)
12+
- [View on docs.rs](https://docs.rs/floating-ui-dom/latest/floating_ui_dom/)
13+
- [View source](https://github.com/RustForWeb/floating-ui/tree/main/packages/dom)
14+
15+
## Usage
16+
317
TODO

book/src/introduction.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Rust Floating UI is a Rust port of [Floating UI](https://floating-ui.com/).
88

99
[Floating UI](https://floating-ui.com) is a library that helps you create “floating” elements such as tooltips, popovers, dropdowns, and more.
1010

11+
It provides a toolkit of positioning features that let you robustly anchor an absolutely-positioned floating element next to a given reference element. For example, a popover floats next to and remains anchored to its triggering button, even while the page scrolls.
12+
13+
It also provides features to avoid collisions with the viewport, as absolute positioning often leads to unwanted overflow depending on the location of the positioning reference.
14+
1115
## Frameworks
1216

1317
Rust Floating UI is available for the following frameworks:
@@ -20,15 +24,18 @@ The following frameworks are under consideration:
2024

2125
- [Dioxus](https://dioxuslabs.com/)
2226

23-
## Smart Anchor Positioning
27+
See [Frameworks](./frameworks/index.md) for documentation for each framework.
2428

25-
Anchor a floating element next to another element while making sure it stays in view by **avoiding collisions**. This lets you position tooltips, popovers, or dropdowns optimally.
29+
## Examples
2630

27-
```toml,trunk
28-
package = "floating-ui-book"
29-
features = ["arrow", "flip", "placement", "shift", "size", "virtual"]
30-
```
31+
See [Examples](./examples.md).
3132

3233
## License
3334

3435
This project is available under the [MIT license](https://github.com/RustForWeb/floating-ui/blob/main/LICENSE.md).
36+
37+
## Rust For Web
38+
39+
The Rust Floating UI project is part of the [Rust For Web](https://github.com/RustForWeb).
40+
41+
[Rust For Web](https://github.com/RustForWeb) creates and ports web UI libraries for Rust. All projects are free and open source.

packages/core/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88

99
This is the platform-agnostic core of Floating UI, exposing the main `compute_position` function but no platform interface logic.
1010

11-
## Rust Floating UI
12-
1311
[Rust Floating UI](https://github.com/RustForWeb/floating-ui) is a Rust port of [Floating UI](https://floating-ui.com).
12+
13+
## Documentation
14+
15+
See [the Rust Floating UI book](https://floating-ui.rustforweb.org/) for documentation.
16+
17+
## Rust For Web
18+
19+
The Rust Floating UI project is part of the [Rust For Web](https://github.com/RustForWeb).
20+
21+
[Rust For Web](https://github.com/RustForWeb) creates and ports web UI libraries for Rust. All projects are free and open source.

packages/dom/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88

99
This is the library to use Floating UI on the web, wrapping `floating-ui-core` with DOM interface logic.
1010

11-
## Rust Floating UI
12-
1311
[Rust Floating UI](https://github.com/RustForWeb/floating-ui) is a Rust port of [Floating UI](https://floating-ui.com).
12+
13+
## Documentation
14+
15+
See [the Rust Floating UI book](https://floating-ui.rustforweb.org/) for documentation.
16+
17+
## Rust For Web
18+
19+
The Rust Floating UI project is part of the [Rust For Web](https://github.com/RustForWeb).
20+
21+
[Rust For Web](https://github.com/RustForWeb) creates and ports web UI libraries for Rust. All projects are free and open source.

packages/leptos/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88

99
This is the library to use Floating UI with Leptos.
1010

11-
## Rust Floating UI
12-
1311
[Rust Floating UI](https://github.com/RustForWeb/floating-ui) is a Rust port of [Floating UI](https://floating-ui.com).
12+
13+
## Documentation
14+
15+
See [the Rust Floating UI book](https://floating-ui.rustforweb.org/) for documentation.
16+
17+
## Rust For Web
18+
19+
The Rust Floating UI project is part of the [Rust For Web](https://github.com/RustForWeb).
20+
21+
[Rust For Web](https://github.com/RustForWeb) creates and ports web UI libraries for Rust. All projects are free and open source.

0 commit comments

Comments
 (0)