You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.6 KiB

  1. ---
  2. layout : 'default'
  3. css : ''
  4. element : 'nag'
  5. elementType : 'module'
  6. title : 'Nag'
  7. description : 'A nag is an important message that persists until dismissed by a user'
  8. type : 'UI Module'
  9. status : 'Undocumented'
  10. ---
  11. <%- @partial('header', { tabs: { overview: 'Overview' } }) %>
  12. <div class="main container">
  13. <div class="ui active tab" data-tab="overview">
  14. <h2 class="ui dividing header">Current Progress</h2>
  15. <div class="ui indicating progress">
  16. <div class="bar" style="width: 60%;">
  17. <div class="progress">60%</div>
  18. </div>
  19. <div class="label">Needs Documentation / Re-coding</div>
  20. </div>
  21. <h2 class="ui dividing header">Usage</h2>
  22. <div class="no example">
  23. <h4 class="ui header"></h4>
  24. <p>Nags are used to present a user with a one time message which will persist until a user acknowledges the message. This can be used for providing notices like the site's use of cookies, or an importan change to a site like a security breach, or an important event.</p>
  25. <p>Semantic's nag component provides built in options for ensuring a nag is only displayed once. You can trigger an API endpoint on dismissal, in order to store a value in your database, or you can use localstorage or cookie value to make sure that a particular computer does not receive the nag again.</p>
  26. </div>
  27. <h2 class="ui dividing header">Example</h2>
  28. <div class="code" data-type="javascript" data-demo="true">
  29. // Wont re-appear unless cleared
  30. $('.cookie.nag')
  31. .nag('show')
  32. ;
  33. </div>
  34. <div class="code" data-type="javascript" data-demo="true">
  35. // Clears cookie so nag shows again
  36. $('.cookie.nag')
  37. .nag('clear')
  38. ;
  39. </div>
  40. <div class="ui code" data-type="html" data-preview="true">
  41. <div class="ui inline cookie nag">
  42. <span class="title">
  43. We use cookies to ensure you get the best experience on our website
  44. </span>
  45. <i class="close icon"></i>
  46. </div>
  47. </div>
  48. <div class="evaluated code" data-type="javascript">
  49. // Automatically shows on init if cookie isnt set
  50. $('.cookie.nag')
  51. .nag({
  52. key : 'accepts-cookies',
  53. value : true
  54. })
  55. ;
  56. </div>
  57. <h2 class="ui dividing header">Support Development</h2>
  58. <div class="no example">
  59. <p>You can help support the future development of the Semantic UI project, and help boost the priority of this component by donating to Semantic UI development.</p>
  60. <p>Please be sure to leave a note in the comments to indicate that you are interested in the development of this particular component.</p>
  61. </div>
  62. </div>
  63. </div>