This is just a technology testing project based on Create React App and TailwindCSS
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

45 lines
1.4KB

  1. import React from 'react'
  2. function PrimaryButton(props) {
  3. const {type, text, action, disabled} = props
  4. return <>
  5. <button
  6. type={type||'button'}
  7. className="
  8. appearance-none
  9. flex
  10. relative
  11. w-full
  12. py-3
  13. border-0
  14. rounded-md
  15. border-primary-800
  16. bg-primary-800
  17. text-white
  18. truncate
  19. cursor-pointer
  20. transform
  21. shadow-md
  22. hover:bg-primary-500
  23. focus:bg-primary-500
  24. focus:outline-none
  25. active:shadow-inner
  26. active:bg-primary-800
  27. active:scale-98
  28. disabled:bg-primary-800
  29. disabled:opacity-50
  30. disabled:shadow-md
  31. disabled:scale-100
  32. disabled:cursor-not-allowed
  33. "
  34. onClick={action}
  35. disabled={disabled}
  36. aria-disabled={disabled}
  37. >
  38. <div className="sm:text-lg flex-grow text-center px-2">{text||'Primary Button'}</div>
  39. </button>
  40. {disabled && <div tabIndex="0" className="sr-only">Disabled button: {text||'Primary Button'}. Please fill all necessary fields.</div>}
  41. </>
  42. }
  43. export default PrimaryButton