Skip to content

Conversation

@luanfreitasdev
Copy link

@luanfreitasdev luanfreitasdev commented Jun 11, 2025

Sometimes we want to show a clickable link to the user, so this PR adds the "href" functionality, which is supported by most current terminals on Linux and macOS.

href(
    message: 'Visit Laravel documentation:',
    path: 'https://laravel.com/docs',
    tooltip: 'Click here'
);

image

@taylorotwell taylorotwell requested a review from jessarcher June 11, 2025 22:05
@taylorotwell taylorotwell marked this pull request as draft June 11, 2025 22:05
@weitzman
Copy link
Contributor

IMO this seems out of scope for this project.

@AlexSkrypnyk
Copy link
Contributor

@weitzman
If prompts supports colours (which is extended terminal capability), why it should not support links?

@weitzman
Copy link
Contributor

These links are great in CLI apps, but its not a Prompt IMO. There is no interactivity. I guess there are Informational Messages and Tables and other bits in this package that have no interactivity so the maintainers should feel free to include this.

@AlexSkrypnyk
Copy link
Contributor

@luanfreitasdev
I've read the code more carefully. Looks like the link is its own element. Is it possible to implement it as a formatter which could be used within existing textual parts of any prompt component? E.g., in hints or labels

@luanfreitasdev
Copy link
Author

@luanfreitasdev I've read the code more carefully. Looks like the link is its own element. Is it possible to implement it as a formatter which could be used within existing textual parts of any prompt component? E.g., in hints or labels

I understand. Any ideas for an API with a display sample?

@luanfreitasdev
Copy link
Author

Updated:

image

@luanfreitasdev
Copy link
Author

Ready for review

@luanfreitasdev luanfreitasdev changed the title Add clickable Link prompt Add Href prompt - like informational messages Nov 27, 2025
@luanfreitasdev luanfreitasdev changed the title Add Href prompt - like informational messages Add Href - like informational messages Nov 27, 2025
@luanfreitasdev luanfreitasdev changed the title Add Href - like informational messages Add Href prompts Nov 27, 2025
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.

3 participants