title: Flask closing flash message
body: <p>I have flash message in my <strong>Flask</strong> app like this:
  <a href="https://i.stack.imgur.com/tFxXX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tFxXX.png" alt="enter image description here"></a></p>
  
  <p>I want to if I click the close icon the flashed message is closing, or automatically closed in a set of time, eg: in 5 second it automatically closed.</p>
  
  <p>Here is my <strong>_flash.html</strong></p>
  
  <pre><code>{% macro render_flashes(class) %}
      {% with msgs = get_flashed_messages(category_filter=[class]) %}
          {% for msg in msgs %}
              &lt;div class="ui {{ class }} message"&gt;
                  &lt;i class="close icon"&gt;&lt;/i&gt;
                  {{ msg }}
              &lt;/div&gt;
          {% endfor %}
      {% endwith %}
  {% endmacro %}
  
  &lt;div class="ui text container"&gt;
      &lt;div class="flashes"&gt;
          {{ render_flashes('error') }}
          {{ render_flashes('warning') }}
          {{ render_flashes('info') }}
          {{ render_flashes('success') }}
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So what do I need to improve my code to do that..?</p>
  
  <p><strong>PS</strong>: for more information, I using this nicely <a href="https://github.com/hack4impact/flask-base/blob/master/app/templates/partials/_flashes.html" rel="nofollow noreferrer">boilerplate</a>.</p>