Skip to content

SvelteKit and Flowbite JS #16

Answered by rhscjohn-dev
rhscjohn-dev asked this question in Q&A
Discussion options

You must be logged in to vote

Here is my Svelte solution to providing the functionality of flowbite.bundle.js to an Alert Dismissible.

It is unclear what the ramifications are, going forward, when not including flowbite.bundle.js in a SvelteKit app!!!

index.svelte

<script>
  let alertElement; // reference to alert element via bind:this(alertElement)
  // handle button click event
  function onClickBtnClose(event) {
    console.log(`onClickBtnClose: id(${alertElement.id})`, event);
    alertElement.classList.toggle("hidden");
  }
</script>

<div class="bg-gray-100">
  <h1 class="text-pink-500 text-2xl text-center">Welcome to SvelteKit</h1>
  <p>
    Visit <a
      href="https://kit.svelte.dev"
      class="font-semibol…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rhscjohn-dev
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Rar9
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants