Beautiful Alert Component with TailwindCSS, Vue & CVA

Поділитися
Вставка
  • Опубліковано 29 вер 2024
  • Code snippets: variantui.com/...

КОМЕНТАРІ • 15

  • @AddMotionLeb
    @AddMotionLeb Рік тому +4

    I think someone is in love with this CVA 😊

  • @VELIXYZ
    @VELIXYZ Рік тому +3

    This is sooo goood and clean. Thank you!

  • @devsystems
    @devsystems 7 місяців тому

    where do I find the source code

  • @matheusdesousamenezes514
    @matheusdesousamenezes514 Рік тому +2

    Really nice! One question:
    Is it safe in terms of performance to declare those cva classes as computed properties? On the examples that i saw on the docs, these were declared on the defineProps function, not as computed

    • @cdruc
      @cdruc  Рік тому +1

      Yes, it's safe.
      But if you don't want/need classes to be "recalculated" (I do) when the props change, just use a function like in the library example 👍

  • @codedjango
    @codedjango Рік тому +1

    We want more components....at the moment I see only this component on variantui

  • @dvlden
    @dvlden Рік тому +1

    I wonder why CVA when we can bind classes as arrays and objects and mixed? I use clsx with React, but nothing in Vue.

    • @cdruc
      @cdruc  Рік тому +2

      objects & arrays are fine, I just find cva to be more readable - even more so when dealing with multiple props/variants

  • @amalebu
    @amalebu Рік тому +1

    Yeay! Thank you

  • @ValentinTzanev
    @ValentinTzanev Рік тому +1

    Is there a good reason to use function as a prop instead of the custom event for dismiss?

    • @dvlden
      @dvlden Рік тому

      I think the best practise in Vue is to always use Event emitting.

    • @cdruc
      @cdruc  Рік тому

      there's good reason, can you guess why? 😃

    • @ValentinTzanev
      @ValentinTzanev Рік тому

      @@cdruc Still wonder! :)

    • @СергейКиршевский
      @СергейКиршевский Рік тому

      @@cdruc i think that this way it will be easier to rewrite close button to a slot

  • @iamsomraj
    @iamsomraj Рік тому

    Hey, can you please the name of your font?