title: laravel 8 x-components in blades
body: <p>I can't figure out the way x-blades are working in laravel.</p>
  <p><strong>Example</strong></p>
  <p>I've created custom <code>textarea</code> component but I can't get values of <code>rows</code> and <code>cols</code> from blade.</p>
  <p><strong>Logic</strong></p>
  <p>If blade provides <code>rows</code> &amp; <code>cols</code> use that if not use static ones.</p>
  <h3>Code</h3>
  <p><code>textarea.blade.php</code></p>
  <pre><code>@props(['disabled' =&gt; false, 'rows' =&gt; '4', 'cols' =&gt; '50'])
  
  &lt;textarea {{ $disabled ? 'disabled' : '' }} rows=&quot;{{ $rows ? $slot : $rows }}&quot; cols=&quot;{{ $cols }}&quot; {!! $attributes-&gt;merge(['class' =&gt; 'form-input rounded-md shadow-sm']) !!}&gt;&lt;/textarea&gt;
  </code></pre>
  <p><code>myform.blade.php</code></p>
  <pre><code>&lt;x-textarea class=&quot;block mt-1 w-full&quot; name=&quot;address&quot; rows=&quot;10&quot; cols=&quot;3&quot; /&gt;
  </code></pre>
  <p><strong>Testing results</strong></p>
  <p><code>cols=&quot;{{ $cols }}&quot;</code> returning static value <code>50</code> from component</p>
  <p><code>rows=&quot;{{ $rows ? $slot : $rows }}&quot;</code> returning <code>rows=&quot;&quot;</code></p>
  <p><strong>any idea?</strong></p>