title: How to display (advanced) customed popups for leaflet in Shiny?
body: <p>I am using <strong>R shiny</strong> to build web applications, and some of them are leveraging the great leaflet features.</p>
  
  <p>I would like to create a <strong>customed and advanced popup</strong>, but I do not know how to proceed.</p>
  
  <p>You can see what I can do in the project I created for this post on <strong><a href="https://github.com/cho7tom/LeafletCustomedPopups" rel="noreferrer">github</a></strong>, or directly in <strong>shinyapp.io <a href="https://cho7tom.shinyapps.io/LeafletCustomedPopups/" rel="noreferrer">here</a></strong></p>
  
  <p>The more complex the popup is, the weirdest my code is, as I am sort of combining R and html in a strange way (see the way I define my custompopup'i' in <strong>server.R</strong>).. </p>
  
  <p><strong>Is there a better way to proceed?</strong> What are the good practices to build such popups? If I plan to display a chart depending on the marker being clicked, should I build them all in advance, or is that possible to build them 'on the fly'? <strong>How can I do that?</strong> </p>
  
  <p>Many thanks in advance for your views on this, please do not hesitate to share your answer here or to directly change my github examples!</p>
  
  <p>Regards</p>