Skip to content
This repository was archived by the owner on Feb 2, 2026. It is now read-only.

Commit ac51ca5

Browse files
Add start of tooltip to Radix Primitives Yew
1 parent ad37fe2 commit ac51ca5

File tree

12 files changed

+1420
-5
lines changed

12 files changed

+1420
-5
lines changed

Cargo.lock

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

book-examples/yew/primitives/Cargo.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,19 @@ radix-yew-label = { path = "../../../packages/primitives/yew/label", optional =
2020
radix-yew-select = { path = "../../../packages/primitives/yew/select", optional = true }
2121
radix-yew-separator = { path = "../../../packages/primitives/yew/separator", optional = true }
2222
radix-yew-switch = { path = "../../../packages/primitives/yew/switch", optional = true }
23+
radix-yew-tooltip = { path = "../../../packages/primitives/yew/tooltip", optional = true }
2324
yew = { workspace = true, features = ["csr"] }
2425

2526
[features]
26-
default = ["aspect-ratio", "avatar", "label", "select", "separator", "switch"]
27+
default = [
28+
"aspect-ratio",
29+
"avatar",
30+
"label",
31+
"select",
32+
"separator",
33+
"switch",
34+
"tooltip",
35+
]
2736
aspect-ratio = ["dep:radix-yew-aspect-ratio"]
2837
avatar = ["dep:radix-yew-avatar"]
2938
label = ["dep:radix-yew-label"]
@@ -36,3 +45,4 @@ select = [
3645
]
3746
separator = ["dep:radix-yew-separator"]
3847
switch = ["dep:radix-yew-switch"]
48+
tooltip = ["dep:radix-yew-tooltip"]

packages/primitives/yew/popper/src/popper.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,10 +548,10 @@ pub struct PopperArrowProps {
548548

549549
// Global attributes
550550
#[prop_or_default]
551-
pub id: Option<String>,
552-
#[prop_or_default]
553551
pub class: Option<String>,
554552
#[prop_or_default]
553+
pub id: Option<String>,
554+
#[prop_or_default]
555555
pub style: Option<String>,
556556

557557
#[prop_or_default]
@@ -568,8 +568,8 @@ pub struct PopperArrowChildProps {
568568
pub attributes: Attributes,
569569

570570
// Global attributes
571-
pub id: Option<String>,
572571
pub class: Option<String>,
572+
pub id: Option<String>,
573573
pub style: String,
574574

575575
// Attributes from `svg`
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "radix-yew-tooltip"
3+
description = "Yew port of Radix Tooltip."
4+
homepage = "https://radix.rustforweb.org/primitives/components/tooltip.html"
5+
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
repository.workspace = true
10+
version.workspace = true
11+
12+
[dependencies]
13+
log.workspace = true
14+
radix-yew-id = { path = "../id", version = "0.0.2" }
15+
radix-yew-popper = { path = "../popper", version = "0.0.2" }
16+
radix-yew-primitive = { path = "../primitive", version = "0.0.2" }
17+
radix-yew-use-controllable-state = { path = "../use-controllable-state", version = "0.0.2" }
18+
radix-yew-visually-hidden = { path = "../visually-hidden", version = "0.0.2" }
19+
web-sys.workspace = true
20+
yew.workspace = true
21+
yew-struct-component.workspace = true
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<p align="center">
2+
<a href="../../../../logo.svg">
3+
<img src="../../../../logo.svg" width="300" height="200" alt="Rust Radix Logo">
4+
</a>
5+
</p>
6+
7+
<h1 align="center">radix-yew-tooltip</h1>
8+
9+
A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
10+
11+
[Rust Radix](https://github.com/RustForWeb/radix) is a Rust port of [Radix](https://www.radix-ui.com/primitives).
12+
13+
## Documentation
14+
15+
See [the Rust Radix book](https://radix.rustforweb.org/) for documentation.
16+
17+
## Rust For Web
18+
19+
The Rust Radix 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.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//! Yew port of [Radix Tooltip](https://www.radix-ui.com/primitives/docs/components/tooltip).
2+
//!
3+
//! A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
4+
//!
5+
//! See [the Rust Radix book](https://radix.rustforweb.org/primitives/components/tooltip.html) for more documentation.
6+
//!
7+
//! See [`@radix-ui/react-tooltip`](https://www.npmjs.com/package/@radix-ui/react-tooltip) for the original package.
8+
9+
mod tooltip;
10+
11+
pub use tooltip::*;

0 commit comments

Comments
 (0)