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

[✨] Be able to switch a <button> to a <link> / <a> but still keeping the styled #947

Open
steffanek opened this issue Aug 26, 2024 · 1 comment
Labels
PKG: headless Related to the headless kit TYPE: enhancement New feature or request

Comments

@steffanek
Copy link
Contributor

Is your feature request related to a problem?

I'm using ToggleGroup, where ToggleGroup.Item are represented as buttons, onValueChange$ I'm updating the URL (pathname and searchParams) and navigating to that URL (using the useNavigate hook)

However, qwik docs said the following:

Notice that for SEO, and accessibility it's better to use the <Link> component instead of useNavigate() programmatically to navigate to a new page after some user interaction.

Buttons is not adviced for SEO.

Describe the solution you'd like

Would be great to be able to switch any component that involved a button to a link.

Describe alternatives you've considered

Passing a props something like hrefProps if the props is given then we switch.

Additional context

No response

@steffanek steffanek added STATUS-1: needs triage This doesn't seem right TYPE: enhancement New feature or request labels Aug 26, 2024
@maiieul
Copy link
Contributor

maiieul commented Aug 26, 2024

The approach we currently use on styled components is smth like class={cn(buttonVariants({ look: 'link' }))}, but not sure if that will be possible for the Toggle. Otherwise we'll need to figure out a way to do the asChild prop.

@maiieul maiieul added PKG: headless Related to the headless kit and removed STATUS-1: needs triage This doesn't seem right labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PKG: headless Related to the headless kit TYPE: enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

4 participants
@steffanek @maiieul and others