timc1 / kbar

fast, portable, and extensible cmd+k interface for your site
https://kbar.vercel.app
MIT License
4.84k stars 185 forks source link

Feature Request: Actions as links #281

Closed joshhunt closed 1 year ago

joshhunt commented 1 year ago

When using kbar to render navigation links, you can't right click -> open in new tab because all actions are rendered as divs.

We would like to be able to set a url property on Actions, and kbar would render them as <a /> links instead of divs to get proper link browser behaviour.

Possibly consumers might like to pass in their own link component to use with something like react-router.

joshhunt commented 1 year ago

We've copied KBarResults into our codebase to render actions with urls as links. Relevent changes are rendering as <a /> if there's a url, and not closing kbar when executing an action while ctrl/cmd/shift keys are clicked.

Is this something you would welcome a PR for? Any changes from our implementation?

timc1 commented 1 year ago

Hey @joshhunt, that make sense and is a pretty trivial update! Feel free to open a PR :)

IlirEdis commented 1 year ago

Is this a feature now? How to add a url to some of my items?

stale[bot] commented 1 year ago

Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.