InputGroupText, icon, buttons and other content can be grouped next to an input by wrapping the addons and input inside .ui-inputgroup element. Multiple addons can be used within the same group as well.

InputGroup - 图1

  • inputgroupdemo.html
  • inputgroupdemo.ts

    inputgroupdemo.html

    View on GitHub
  1. <h3 class="first">Addons</h3>
  2. <div class="ui-g ui-fluid">
  3. <div class="ui-g-12 ui-md-4">
  4. <div class="ui-inputgroup">
  5. <span class="ui-inputgroup-addon"><i class="fa fa-user"></i></span>
  6. <input type="text" pInputText placeholder="Username">
  7. </div>
  8. </div>
  9. <div class="ui-g-12 ui-md-4">
  10. <div class="ui-inputgroup">
  11. <span class="ui-inputgroup-addon">$</span>
  12. <input type="text" pInputText placeholder="Price">
  13. <span class="ui-inputgroup-addon">.00</span>
  14. </div>
  15. </div>
  16. <div class="ui-g-12 ui-md-4">
  17. <div class="ui-inputgroup">
  18. <span class="ui-inputgroup-addon">www</span>
  19. <input type="text" pInputText placeholder="Website">
  20. </div>
  21. </div>
  22. </div>
  23. <h3>Multiple Addons</h3>
  24. <div class="ui-g">
  25. <div class="ui-g-12">
  26. <div class="ui-inputgroup">
  27. <span class="ui-inputgroup-addon"><i class="fa fa-credit-card"></i></span>
  28. <span class="ui-inputgroup-addon"><i class="fa fa-cc-visa"></i></span>
  29. <input type="text" pInputText placeholder="Price">
  30. <span class="ui-inputgroup-addon">$</span>
  31. <span class="ui-inputgroup-addon">.00</span>
  32. </div>
  33. </div>
  34. </div>
  35. <h3>Button Addons</h3>
  36. <div class="ui-g ui-fluid">
  37. <div class="ui-g-12 ui-md-4">
  38. <div class="ui-inputgroup">
  39. <button pButton type="button" label="Search"></button>
  40. <input type="text" pInputText placeholder="Keyword">
  41. </div>
  42. </div>
  43. <div class="ui-g-12 ui-md-4">
  44. <div class="ui-inputgroup">
  45. <input type="text" pInputText placeholder="Keyword">
  46. <button pButton type="button" icon="fa fa-superpowers" class="ui-button-warn"></button>
  47. </div>
  48. </div>
  49. <div class="ui-g-12 ui-md-4">
  50. <div class="ui-inputgroup">
  51. <button pButton type="button" icon="pi pi-check" class="ui-button-success"></button>
  52. <input type="text" pInputText placeholder="Vote">
  53. <button pButton type="button" icon="pi pi-close" class="ui-button-danger"></button>
  54. </div>
  55. </div>
  56. </div>
  57. <h3>Checkbox and RadioButton</h3>
  58. <div class="ui-g ui-fluid">
  59. <div class="ui-g-12 ui-md-4">
  60. <div class="ui-inputgroup">
  61. <span class="ui-inputgroup-addon"><p-checkbox></p-checkbox></span>
  62. <input type="text" pInputText placeholder="Username">
  63. </div>
  64. </div>
  65. <div class="ui-g-12 ui-md-4">
  66. <div class="ui-inputgroup">
  67. <input type="text" pInputText placeholder="Price">
  68. <span class="ui-inputgroup-addon"><p-radioButton></p-radioButton></span>
  69. </div>
  70. </div>
  71. <div class="ui-g-12 ui-md-4">
  72. <div class="ui-inputgroup">
  73. <span class="ui-inputgroup-addon"><p-checkbox></p-checkbox></span>
  74. <input type="text" pInputText placeholder="Website">
  75. <span class="ui-inputgroup-addon"><p-radioButton></p-radioButton></span>
  76. </div>
  77. </div>
  78. </div>
  79.  

inputgroupdemo.ts

  1. export class InputGroupDemo {
  2. }
  3.