Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add props from Radix tooltip primitives to tooltip component #2499

Merged
merged 2 commits into from Jan 31, 2024

Conversation

martinxu9
Copy link
Contributor

Summary

  • Add props from Radix tooltip primitives to tooltip component.
  • Based on the Radix docs, the Tooltip component from Radix Themes inherits and merges props from the primitive Root/Content/Portal parts
  • Example (only some common props):
rdxt.flex(
    rdxt.tooltip(
        rdxt.button("tooltip on right"),
        content="Tooltip content showing on right",
        side="right",
    ),
    rdxt.tooltip(
        rdxt.button("tooltip on bottom"),
        content="Tooltip content showing on bottom",
        side="bottom",
    ),
    rdxt.tooltip(
        rdxt.button("tooltip on left"),
        content="Tooltip content showing on left",
        side="left",
    ),
    rdxt.tooltip(
        rdxt.button("tooltip on top"),
        content="Tooltip content showing on top",
        side="top",
    ),
    rdxt.tooltip(
        rdxt.button("tooltip disable_hoverable_content on right"),
        content="Tooltip content showing while you focus away from button and onto the tooltip content",
        side="right",
        disable_hoverable_content=False,
    ),
    rdxt.tooltip(
        rdxt.button("tooltip on bottom faraway"),
        content="Tooltip content showing on bottom 300px away",
        side="bottom",
        side_offset=300,
    ),
    direction="column",
    gap="2",
),

reflex/reflex.py Outdated Show resolved Hide resolved
picklelo
picklelo previously approved these changes Jan 31, 2024
@martinxu9 martinxu9 merged commit 38845db into main Jan 31, 2024
45 checks passed
@martinxu9 martinxu9 deleted the martinxu9/tooltip-props branch January 31, 2024 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants