Skip to content

Indent

Create an indented block of source text. The indented block starts a new line at the new indentation level and, with trailingBreak, ends with a new line after restoring the indentation level. The default line break is a hard line break suitable for typical blocks of statements but can be configured.

import { Indent } from "@alloy-js/core";
<Indent hardline line nobreak softline trailingBreak>
{children}
</Indent>

Props

childrenChildren
hardlineoptionalboolean

Use a hard line (<hbr />) to start (and optionally end with trailingBreak) the new indentation level.

lineoptionalboolean

Use a regular line (<br />) to start (and optionally end with trailingBreak) the new indentation level.

nobreakoptionalboolean

Don’t include a line break. The new indentation level will start after the first linebreak within the children.

softlineoptionalboolean

Use a soft line (<sbr />) to start (and optionally end with trailingBreak) the new indentation level.

trailingBreakoptionalboolean

Place the configured line break at the end of the block after restoring the indentation level.