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

Allows use of html in label, or alternately overwriting it entirely. … #1096

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

kryptus36
Copy link
Contributor

Closes #1092

@stackblitz
Copy link

stackblitz bot commented Sep 30, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel
Copy link

vercel bot commented Sep 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-svelte ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2023 7:45pm
flowbite-svelte-update ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2023 7:45pm

@shinokada
Copy link
Collaborator

Why you need a named slot?

      {@html label}

or

   <slot>
      {@html label}
    </slot>

should be enough.

@jjagielka
Copy link
Contributor

In fact it should be simply:

<slot>{label}</slot>

and to make it even simpler we should remove the label prop from exports and use <slot/> for all labels. So instead of:

<FloatingLabelInput style="filled" id="floating_filled" name="floating_filled" type="text" label="Floating filled" />

we would use that as:

<FloatingLabelInput style="filled" id="floating_filled" name="floating_filled" type="text">
   Floating filled <span>containg html</span>
</FloatingLabelInput>

@kryptus36
Copy link
Contributor Author

If you remove the label prop you break backwards compatibility.Naming the slot isn't strictly necessary. Let me know which solution is preferred and I'll update it. I was going for maximum flexibility.

@shinokada
Copy link
Collaborator

Please remove the label props and just add <slot />, since it is not a v1 yet.

@shinokada
Copy link
Collaborator

@shinokada shinokada merged commit 0f508db into themesberg:main Oct 11, 2023
3 checks passed
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.

allow for html in the label of a FloatingLabelInput
3 participants