{"route":"/en-US-v0.13.1/reference/visualize/square/","title":"Square","description":"Documentation for the `square` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-size","name":"size","children":[]},{"id":"parameters-width","name":"width","children":[]},{"id":"parameters-height","name":"height","children":[]},{"id":"parameters-fill","name":"fill","children":[]},{"id":"parameters-stroke","name":"stroke","children":[]},{"id":"parameters-radius","name":"radius","children":[]},{"id":"parameters-inset","name":"inset","children":[]},{"id":"parameters-outset","name":"outset","children":[]},{"id":"parameters-body","name":"body","children":[]}]}],"body":{"kind":"func","content":{"path":[],"name":"square","title":"Square","keywords":[],"oneliner":"A square with optional content.","element":true,"contextual":false,"deprecation":null,"details":"<p>A square with optional content.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-comment\">// Without content.</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">square</span><span class=\"typ-punct\">(</span>size<span class=\"typ-punct\">:</span> <span class=\"typ-num\">40pt</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-comment\">// With content.</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">square</span><span class=\"typ-punct\">[</span>\n  Automatically <span class=\"typ-escape\">\\</span>\n  sized to fit.\n<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/e35a80a6686ae7fe68882233aa8efee.png\" alt=\"Preview\"></div></div>","example":null,"self":false,"params":[{"name":"size","details":"<p>The square's side length. This is mutually exclusive with <code>width</code> and\n<code>height</code>.</p>","example":null,"types":["auto","length"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"width","details":"<p>The square's width. This is mutually exclusive with <code>size</code> and <code>height</code>.</p>\n<p>In contrast to <code>size</code>, this can be relative to the parent container's\nwidth.</p>","example":null,"types":["auto","relative"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"height","details":"<p>The square's height. This is mutually exclusive with <code>size</code> and <code>width</code>.</p>\n<p>In contrast to <code>size</code>, this can be relative to the parent container's\nheight.</p>","example":null,"types":["auto","relative","fraction"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"fill","details":"<p>How to fill the square. See the <a href=\"/en-US-v0.13.1/reference/visualize/rect/#parameters-fill\">rectangle's documentation</a>\nfor more details.</p>","example":null,"types":["none","color","gradient","tiling"],"strings":[],"default":"<code><span class=\"typ-key\">none</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"stroke","details":"<p>How to stroke the square. See the\n<a href=\"/en-US-v0.13.1/reference/visualize/rect/#parameters-stroke\">rectangle's documentation</a> for more details.</p>","example":null,"types":["none","auto","length","color","gradient","stroke","tiling","dictionary"],"strings":[],"default":"<code><span class=\"typ-key\">auto</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"radius","details":"<p>How much to round the square's corners. See the\n<a href=\"/en-US-v0.13.1/reference/visualize/rect/#parameters-radius\">rectangle's documentation</a> for more details.</p>","example":null,"types":["relative","dictionary"],"strings":[],"default":"<code><span class=\"typ-punct\">(</span><span class=\"typ-punct\">:</span><span class=\"typ-punct\">)</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"inset","details":"<p>How much to pad the square's content. See the\n<a href=\"/en-US-v0.13.1/reference/layout/box/#parameters-inset\">box's documentation</a> for more details.</p>","example":null,"types":["relative","dictionary"],"strings":[],"default":"<code><span class=\"typ-num\">0%</span> <span class=\"typ-op\">+</span> <span class=\"typ-num\">5pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"outset","details":"<p>How much to expand the square's size without affecting the layout. See\nthe <a href=\"/en-US-v0.13.1/reference/layout/box/#parameters-outset\">box's documentation</a> for more details.</p>","example":null,"types":["relative","dictionary"],"strings":[],"default":"<code><span class=\"typ-punct\">(</span><span class=\"typ-punct\">:</span><span class=\"typ-punct\">)</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"body","details":"<p>The content to place into the square. The square expands to fit this\ncontent, keeping the 1-1 aspect ratio.</p>\n<p>When this is omitted, the square takes on a default size of at most\n<code><span class=\"typ-num\">30pt</span></code>.</p>","example":null,"types":["none","content"],"strings":[],"default":"<code><span class=\"typ-key\">none</span></code>","positional":true,"named":false,"required":false,"variadic":false,"settable":true}],"returns":["content"],"scope":[]}}}