<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="201747" data-post-id="201747">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="msaraiva" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/msaraiva/120/1214_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  msaraiva
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Broadway Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="benregn" data-post="78" data-topic="27671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benregn/48/20356_2.png" class="avatar"> benregn:</div>
<blockquote>
<p>is it somehow possible to use Surface components layouts, e.g. in <code>live.html.leex</code></p>
</blockquote>
</aside>
<p>Hi <a class="mention" href="/u/benregn" rel="nofollow">@benregn</a>! I believe the only way to make that work today would be to implement <code>render/2</code> in you view to avoid having Phoenix handling the template directly. Then you could you use <code>~H</code> inside <code>render/2</code> as in any other Surface component. In case that doesn’t work or if it’s not ideal for you, please open an issue at <a href="https://github.com/msaraiva/surface/issues/" class="inline-onebox" rel="noopener nofollow ugc">Issues · surface-ui/surface · GitHub</a> so we can discuss possible solutions.</p>
<aside class="quote no-group" data-username="darraghenright" data-post="81" data-topic="27671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/darraghenright/48/6418_2.png" class="avatar"> darraghenright:</div>
<blockquote>
<p>Still curious about this error but thinking about what I am trying to do, and it seems like it might be a better idea to control this sort of thing in the LV (which is what I was doing initially). Still trying to find where to draw that line between LV/Surface and Alpine.</p>
</blockquote>
</aside>
<p>Hi <a class="mention" href="/u/darraghenright" rel="nofollow">@darraghenright</a>! We’re currently discussing some changes in Surface’s syntax to avoid conflicts with client libs. One change that is already scheduled for the next version is to ignore <code>&lt;template&gt;</code> and <code>&lt;slot&gt;</code> and introduce their surface’s component counterparts: <code>&lt;Template&gt;</code> and <code>&lt;Slot&gt;</code>. In the meantime, if you need to make <code>&lt;template&gt;</code> hit the browser, you can use <code>&lt;#Raw&gt;</code> to bypass Surface’s compiler, for instance:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  &lt;#Raw&gt;&lt;template x-if="showModal"&gt;&lt;/#Raw&gt;
    &lt;div class="modal"&gt;
      ...
      &lt;button @click="showModal = false"&gt;close&lt;/button&gt;
    &lt;/div&gt;
  &lt;#Raw&gt;&lt;/template&gt;&lt;/#Raw&gt;
</code></pre>
<p>Don’t forget to <code>alias Surface.Components.Raw</code> in your component.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="201747" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/84">Post #83</a>
	                </div>
	            </div>
              <div id="likers-container-201747" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="201747"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #83"></div>
  </section>
</div>
    <div class="postbit" id="201769" data-post-id="201769">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="darraghenright" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/darraghenright/120/6418_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  darraghenright
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Absolutely fantastic. Thanks a million <a class="mention" href="/u/msaraiva" rel="nofollow">@msaraiva</a>!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="201769" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/85">Post #84</a>
	                </div>
	            </div>
              <div id="likers-container-201769" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="201769"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #84"></div>
  </section>
</div>
    <div class="postbit" id="202782" data-post-id="202782">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="the_wildgoose" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  the_wildgoose
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I wonder if you might help scribble out how you would handle a theoretical “Card” component with optional slots.</p>
<p>So imagine you wanted a final template to look like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  &lt;Card&gt;
    &lt;Header class="stuff"&gt;
      header
    &lt;/Header&gt;

    Body text

    &lt;Footer class="footer stuff"&gt;
      my footer
    &lt;/Footer&gt;
  &lt;/Card
</code></pre>
<p>So I initially thought to model this as per your example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule ExampleWeb.Component.Card do
  @moduledoc false

  use ExampleWeb, :surface_component

  slot header

  slot default

  slot footer

  def render(assigns) do
    ~H"""
    &lt;div class="card"&gt;
      &lt;div class="@header_class"&gt;
        &lt;slot name="header"/&gt;
      &lt;/div&gt;
      &lt;div class="body class"&gt;
        &lt;slot /&gt;
      &lt;/div&gt;
      &lt;div class="@footer_class"&gt;
        &lt;slot name="footer"/&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    """
  end
end
</code></pre>
<p>But what if we add in the requirement as here that we want to pull the header and footer classes out of the slots and also want to suppress rendering of one of the sections if it’s blank? ie if the header slot is say empty then we render nothing at all</p>
<p>I suppose that the first step is to stop using slots and instead make the header and footer a component so that they can render their own divs, rather than doing it in the Card component? However, is there a different solution?</p>
<p>I’m not quite sure of my use case yet, but I’m thinking about situations where I might have say optional icons or some other attribute and I’m wondering how I might say compute some css class that would depend on whether the icon slot had been filled or not? Can I get your thoughts?</p>
<p>Note, really liking Surface so far! Thanks for creating it!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202782" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/86">Post #85</a>
	                </div>
	            </div>
              <div id="likers-container-202782" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202782"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #85"></div>
  </section>
</div>
    <div class="postbit" id="202830" data-post-id="202830">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="msaraiva" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/msaraiva/120/1214_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  msaraiva
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Broadway Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi <a class="mention" href="/u/the_wildgoose" rel="nofollow">@the_wildgoose</a>!</p>
<p>You can use <code>slot_assigned?/1</code> to check if a slot has been assigned or not.</p>
<p>Assuming only header and footer are optional, something like this should be enough:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  slot header

  slot default, required: true

  slot footer

  def render(assigns) do
    ~H"""
    &lt;div class="card"&gt;
      &lt;div :if={{ slot_assigned?(:header) }} class={{ @header_class }}&gt;
        &lt;slot name="header"/&gt;
      &lt;/div&gt;
      &lt;div class="body class"&gt;
        &lt;slot/&gt;
      &lt;/div&gt;
      &lt;div :if={{ slot_assigned?(:footer) }} class={{ @footer_class }}&gt;
        &lt;slot name="footer"/&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    """
  end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202830" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/87">Post #86</a>
	                </div>
	            </div>
              <div id="likers-container-202830" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202830"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #86"></div>
  </section>
</div>
    <div class="postbit" id="202847" data-post-id="202847">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="olivermt" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/olivermt/120/2354_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  olivermt
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You can use my implementation here as inspiration:</p>
<p><a href="https://github.com/surface-ui/surface_bulma/blob/master/lib/surface_bulma/modal/card.ex" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/surface-ui/surface_bulma/blob/master/lib/surface_bulma/modal/card.ex</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202847" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/88">Post #87</a>
	                </div>
	            </div>
              <div id="likers-container-202847" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202847"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #87"></div>
  </section>
</div>
    <div class="postbit" id="202927" data-post-id="202927">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="the_wildgoose" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  the_wildgoose
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is all really helpful! Thanks guys! I can get a lot of inspiration from the bulma components, some of this is not so easy to get your head around just from the docs, eg I found the button example helpful with the multiple “is_<span class="mention">@colour</span>: <span class="mention">@colour</span>” kinds of properties, as an example of what is possible! Nice!</p>
<p>As I have your attention, I have 2 follow on questions.</p>
<p>1 - I posted this also as an issue on github, but it seems to me that in the Card example, once you declare “Head” as a slot, then it’s render function becomes disabled? Looking at the code I’m not sure why though. I see that component declares a default render function in this case, but also marks it overrideable? I tried to follow through the rest of the render path, but it’s quite complex…</p>
<p>It seems useful to me to be able to set a render function for slots. The use would be that the upper level component understands where to place the slot in the layout, but the sub component might know how to render that slot.</p>
<p>Could we support this easily?</p>
<p>2 - I guess this is a failure to read the docs right, but could you give me a leg up on understanding how I would fish out a property from a slot component and use it back in the upper component,</p>
<p>eg imagine we had</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;Footer class="footer_class" show="true"&gt;
  stuff
&lt;/Footer&gt;
</code></pre>
<p>and we want to place this into a template, but how can we read the Footer class/show variables? There is an example in the grids section, but I’m not sure I understand how to apply what is written?</p>
<p>eg I want to achieve something like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;Card&gt;
  stuff
  &lt;div class=@footer.class&gt;
    &lt;Footer class="footer_class" show="true"&gt;
      more stuff
    &lt;/Footer&gt;
  &lt;/div&gt;
&lt;/Card&gt;
</code></pre>
<p>Thanks for your advice</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202927" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/89">Post #88</a>
	                </div>
	            </div>
              <div id="likers-container-202927" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202927"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #88"></div>
  </section>
</div>
    <div class="postbit" id="203398" data-post-id="203398">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="the_wildgoose" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  the_wildgoose
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>OK, another, hopefully quick question:</p>
<p>How would I access the “flash” from a component?</p>
<p>So I can see in the code there are default “data flash” properties already setup. In the top level view I can access either <span class="mention">@flash</span> or assigns.flash, however, this has disappeared from the assigns list once I am in the render function for some component called from the view?</p>
<p>In most ways I expect this result. However, looking at the code I wonder if you wanted it to be otherwise? Should we pass down the flash value to sub components ? (or am I just missing the obvious way to do it?)</p>
<p>At present I can achieve the end result by wrapping my top level view with a &lt;Context put={{flash: assigns.flash}} and then do a get in the sub component(s). However, I can’t create a “prop flash, :map”, which would allow passing as a simple property, because there is this already existing data definition? (obviously I can create a different name - my point was that the name looks reserved for some use?)</p>
<p>My use case is that my view looks something like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">
~H"""
&lt;SiteBoilerPlate&gt;

... interesting stuff
&lt;/SiteBoilerPlate&gt;
"""
</code></pre>
<p>and I would like to shift managing the display of the flash into this SiteBoilerPlate component, which generates all the outer framework of the views.</p>
<p>Thanks</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="203398" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/90">Post #89</a>
	                </div>
	            </div>
              <div id="likers-container-203398" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="203398"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #89"></div>
  </section>
</div>
    <div class="postbit" id="205103" data-post-id="205103">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dblack" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dblack/120/40394_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dblack
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>G’day, just wondering if it’s possible to pass components as props to components?</p>
<p>Say I’ve got a <code>Button</code> component, and some <code>Icon</code> components. Sometimes I’d like to show an Icon component with the text on a Button… this works well:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;Button&gt;
  &lt;Icon.Pencil class={{"-ml-1", "mr-2", "h-5", "w-5"}} /&gt;
  Add New
&lt;/Button&gt;
</code></pre>
<p>The API I’d like to provide on the Button component should hopefully allow something like this:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;Button icon={{ Icon.Pencil }} title="Add New" /&gt;
</code></pre>
<p>Then the button component can add those utility classes to the Icon. I see there is a <code>:module</code> property type, but when I set the icon prop to that, I need some way to ‘instantiate’ it as a component.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="205103" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/91">Post #90</a>
	                </div>
	            </div>
              <div id="likers-container-205103" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="205103"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #90"></div>
  </section>
</div>
    <div class="postbit" id="205142" data-post-id="205142">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dblack" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dblack/120/40394_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dblack
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Well, this was pretty simple in the end, but I’d love to hear if it’s unsupported/frowned upon/likely to blow up in my face! My <code>Button</code> component ended up looking something like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Component.Button do
  use Surface.Component

  prop title, :string, required: false, default: ""
  prop icon, :module, required: false, default: nil
  slot default, required: false

  def render(assigns) do
    ~H"""
    &lt;button&gt;
      {{ get_icon(assigns) }}&lt;slot&gt;{{ @title }}&lt;/slot&gt;
    &lt;/button&gt;
    """
  end

  defp get_icon(%{icon: icon}) when icon != nil do
    icon.render(%{class: ["-ml-1", "mr-2", "h-5", "w-5"]})
  end

  defp get_icon(_) do
    ""
  end
end

</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="205142" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/92">Post #91</a>
	                </div>
	            </div>
              <div id="likers-container-205142" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="205142"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #91"></div>
  </section>
</div>
    <div class="postbit" id="205261" data-post-id="205261">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cschmatzler" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cschmatzler/120/35101_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cschmatzler
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi!<br>
Is there a way to access a prop in <code>mount/1</code> of a <code>Surface.LiveComponent</code>? Essentially I am passing the currently logged in user from my live view as a prop and would then like my component to fetch extra information from the database, for which I would need to access that user id. At the time <code>mount/1</code> is called, though, it does not seem like the assigns are available?<br>
Right now I am just loading the information in the view itself, but that does not encapsulate the concerns perfectly.</p>
<p>Cheers</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="205261" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671/93">Post #92</a>
	                </div>
	            </div>
              <div id="likers-container-205261" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="205261"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #92"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/27671/load_more?page=10">Load more posts (124 remaining)</a>
</div></template></turbo-stream>