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

[Feature Request] Allow Form Group's Hints to be passed as a slot instead of a prop. #540

Closed
kerunix opened this issue Aug 15, 2023 · 0 comments · Fixed by #714
Closed
Labels
enhancement New feature or request

Comments

@kerunix
Copy link

kerunix commented Aug 15, 2023

Hello everyone and thanks for this nice library.

Here's my feature request :

Is your feature request related to a problem? Please describe.

Sometimes hints are a bit too long to be displayed in a single line on the top right of the input, like for a password format on a sign up page for example. Some other time, you may want to display a link or a button as a hint, linking to something like a TOS page or a password reset flow. Or you might simply want to add attributes to the hint element or change it's html tag to something more semantic.

In those case the current way of displaying a hint is not good since it only accepts a string as a prop to be rendered in a span.

Describe the solution you'd like

Add a <slot name="hint"> to FormGroup's template that would allow users to pass their own markup to the component. The current <span v-if="hint" :class="[ui.hint]">{{ hint }}</span> would be rendered as a default content to the slot.

Describe alternatives you've considered

I don't think there is another clear solution to this. Maybe just don't implement the feature if this is not something you feel like you should support.

Additional context

My main request here is about the hint prop but I guess this could also be implemented for the help (same reasoning here) and error (to allow displaying a formatted list of errors or a link to an FAQ for example) slots as well.

If this is something you'd like to see, I'm willing to work on this.

Thanks for your time.

@kerunix kerunix added the enhancement New feature or request label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant