dot-agent / nextpy

🤖Self-Modifying Framework from the Future 🔮 World's First AMS
https://dotagent.ai
Apache License 2.0
2.2k stars 155 forks source link

When I click on image, it's not opening the link #128

Closed anirudh-hegde closed 9 months ago

anirudh-hegde commented 9 months ago
xt.button(
                # xt.link("https://github.com/anirudh-hegde", ),
                # on_click=lambda : open_github),
                xt.image(
                    src="/github.svg",
                    height="30px",
                    width="30px",
                    padding_right='1px',
                    target="https://github.com/anirudh-hegde"
                ),
            ),
Raj4646 commented 9 months ago

Wrap the xt.image component inside a xt.link component and use "href" prop for the xt.link component.

xt.link(
          xt.image(
                   src="/github.svg",
                   height="30px",
                   width="30px",
                   padding_right='1px',),
href="https://github.com/anirudh-hegde",
)

You can also pass "is_external=True," if you want the link to open in a new tab!