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 Link component #258

Open
arjendevos opened this issue May 13, 2024 · 1 comment
Open

Add Link component #258

arjendevos opened this issue May 13, 2024 · 1 comment
Labels

Comments

@arjendevos
Copy link

Currently I can add a Link component like this:

<CommandItem variant="muted">
  <Link className="grow" href="/settings">
    <Cog6ToothIcon className="mr-2 size-4" />
    settings
  </Link>
</CommandItem>

However I have a few requests:

  • Use the child component as main one, so I can apply the same styling to the Link component (asChild)
  • Propagate the onSelect with to an onClick to the child component (or asChild^)
@pacocoursey pacocoursey changed the title Use with link component Add Link component May 19, 2024
@Willem-Jaap
Copy link

I ran into the same issue, currently I do this:
image

I read in https://github.com/pacocoursey/cmdk/blob/main/ARCHITECTURE.md you don't want to support render props. this is just an idea but maybe you can provide an as prop for passing custom link components like next/link
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants