{"route":"/en-US-v0.13.1/reference/layout/repeat/","title":"Repeat","description":"Documentation for the `repeat` function.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"example","name":"Example","children":[]},{"id":"parameters","name":"Parameters","children":[{"id":"parameters-body","name":"body","children":[]},{"id":"parameters-gap","name":"gap","children":[]},{"id":"parameters-justify","name":"justify","children":[]}]}],"body":{"kind":"func","content":{"path":[],"name":"repeat","title":"Repeat","keywords":[],"oneliner":"Repeats content to the available space.","element":true,"contextual":false,"deprecation":null,"details":"<p>Repeats content to the available space.</p>\n<p>This can be useful when implementing a custom index, reference, or outline.</p>\n<p>Space may be inserted between the instances of the body parameter, so be\nsure to adjust the <a href=\"/en-US-v0.13.1/reference/layout/repeat/#parameters-justify\"><code>justify</code></a> parameter accordingly.</p>\n<p>Errors if there are no bounds on the available space, as it would create\ninfinite content.</p>\n<h2 id=\"example\">Example</h2>\n<div class=\"previewed-code\"><pre><code>Sign on the dotted line:\n<span class=\"typ-func\">#</span><span class=\"typ-func\">box</span><span class=\"typ-punct\">(</span>width<span class=\"typ-punct\">:</span> <span class=\"typ-num\">1fr</span><span class=\"typ-punct\">,</span> <span class=\"typ-func\">repeat</span><span class=\"typ-punct\">[</span>.<span class=\"typ-punct\">]</span><span class=\"typ-punct\">)</span>\n\n<span class=\"typ-key\">#</span><span class=\"typ-key\">set</span> <span class=\"typ-func\">text</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">10pt</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">v</span><span class=\"typ-punct\">(</span><span class=\"typ-num\">8pt</span><span class=\"typ-punct\">,</span> weak<span class=\"typ-punct\">:</span> <span class=\"typ-key\">true</span><span class=\"typ-punct\">)</span>\n<span class=\"typ-func\">#</span><span class=\"typ-func\">align</span><span class=\"typ-punct\">(</span>right<span class=\"typ-punct\">)</span><span class=\"typ-punct\">[</span>\n  Berlin, the 22nd of December, 2022\n<span class=\"typ-punct\">]</span>\n</code></pre><div class=\"preview\"><img src=\"/en-US-v0.13.1/assets/2c620b6b8e39dd107ac681286f399070.png\" alt=\"Preview\"></div></div>","example":null,"self":false,"params":[{"name":"body","details":"<p>The content to repeat.</p>","example":null,"types":["content"],"strings":[],"default":null,"positional":true,"named":false,"required":true,"variadic":false,"settable":false},{"name":"gap","details":"<p>The gap between each instance of the body.</p>","example":null,"types":["length"],"strings":[],"default":"<code><span class=\"typ-num\">0pt</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true},{"name":"justify","details":"<p>Whether to increase the gap between instances to completely fill the\navailable space.</p>","example":null,"types":["bool"],"strings":[],"default":"<code><span class=\"typ-key\">true</span></code>","positional":false,"named":true,"required":false,"variadic":false,"settable":true}],"returns":["content"],"scope":[]}}}