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>
import { Block } from "@alloy-js/core/stc";
Block({ closer: string, newline: boolean, opener: string }).children(children)
Props
children | optionalChildren The block’s contents |
closer | optionalstring The closing punctuation of the block. Defaults to ”}“. |
newline | optionalboolean Whether the block starts on a new line. When true, a hardline is added prior to the block. |
opener | optionalstring The opening punctuation of the block. Defaults to ”{”. |