{"route":"/en-US-v0.14.1/reference/layout/pad/","title":"Padding","description":"Documentation for the `pad` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-left","name":"left","children":[]},{"id":"parameters-top","name":"top","children":[]},{"id":"parameters-right","name":"right","children":[]},{"id":"parameters-bottom","name":"bottom","children":[]},{"id":"parameters-x","name":"x","children":[]},{"id":"parameters-y","name":"y","children":[]},{"id":"parameters-rest","name":"rest","children":[]},{"id":"parameters-body","name":"body","children":[]}]}],"body":{"kind":"func","content":{"path":[],"name":"pad","title":"Padding","keywords":[],"oneliner":"Adds spacing around content.","element":true,"contextual":false,"deprecationMessage":null,"deprecationUntil":null,"details":[{"kind":"html","content":"<p>Adds spacing around content.</p>\n<p>The spacing can be specified for each side individually, or for all sides at\nonce by specifying a positional argument.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code><span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>center<span class=\"typ-punct\">)</span>\n\n<span class=\"typ-func\">#</span><span class=\"typ-func\">pad</span><span class=\"typ-punct\">(</span>x<span class=\"typ-punct\">:</span> <span class=\"typ-num\">16pt</span><span class=\"typ-punct\">,</span> <span class=\"typ-func\">image</span><span class=\"typ-punct\">(</span><span class=\"typ-str\">&quot;typing.jpg&quot;</span><span class=\"typ-punct\">)</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-emph\">_Typing speeds can be\n measured in words per minute._</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.14.1/assets/627bf363796cd87adc3e0a240ccc55ab.png\" alt=\"Preview\"></div></div>"}],"self":false,"params":[{"name":"left","details":[{"kind":"html","content":"<p>The padding at the left side.</p>"}],"types":["relative"],"strings":[],"default":"<code><span class=\"typ-num\">0%</span> <span class=\"typ-op\">+</span> <span class=\"typ-num\">0pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"top","details":[{"kind":"html","content":"<p>The padding at the top side.</p>"}],"types":["relative"],"strings":[],"default":"<code><span class=\"typ-num\">0%</span> <span class=\"typ-op\">+</span> <span class=\"typ-num\">0pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"right","details":[{"kind":"html","content":"<p>The padding at the right side.</p>"}],"types":["relative"],"strings":[],"default":"<code><span class=\"typ-num\">0%</span> <span class=\"typ-op\">+</span> <span class=\"typ-num\">0pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"bottom","details":[{"kind":"html","content":"<p>The padding at the bottom side.</p>"}],"types":["relative"],"strings":[],"default":"<code><span class=\"typ-num\">0%</span> <span class=\"typ-op\">+</span> <span class=\"typ-num\">0pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"x","details":[{"kind":"html","content":"<p>A shorthand to set <code>left</code> and <code>right</code> to the same value.</p>"}],"types":["relative"],"strings":[],"default":"<code><span class=\"typ-num\">0%</span> <span class=\"typ-op\">+</span> <span class=\"typ-num\">0pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":false},{"name":"y","details":[{"kind":"html","content":"<p>A shorthand to set <code>top</code> and <code>bottom</code> to the same value.</p>"}],"types":["relative"],"strings":[],"default":"<code><span class=\"typ-num\">0%</span> <span class=\"typ-op\">+</span> <span class=\"typ-num\">0pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":false},{"name":"rest","details":[{"kind":"html","content":"<p>A shorthand to set all four sides to the same value.</p>"}],"types":["relative"],"strings":[],"default":"<code><span class=\"typ-num\">0%</span> <span class=\"typ-op\">+</span> <span class=\"typ-num\">0pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":false},{"name":"body","details":[{"kind":"html","content":"<p>The content to pad at the sides.</p>"}],"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false}],"returns":["content"],"scope":[]}}}