Skip to content

Block

Create an indented block of source text. The block has opener text which is added prior to the block, which defaults to "{", and closer text which is added after the block, which defaults to "}".

import { Block } from "@alloy-js/core";
<Block closer="string" newline opener="string">
{children}
</Block>

Props

childrenoptionalChildren

The block’s contents

closeroptionalstring

The closing punctuation of the block. Defaults to ”}“.

newlineoptionalboolean

Whether the block starts on a new line. When true, a hardline is added prior to the block.

openeroptionalstring

The opening punctuation of the block. Defaults to ”{”.