Blockcomponent
Block({ as: Element = "div", children, ...props }: BlockProps): ReactElement| Param | Type | |
|---|---|---|
props | BlockProps | Props for Block — colour, space, typography, and width variants plus an optional as element override. required |
.as | BlockElement | Element this <Block> renders as, e.g. "header" to output a "<header>" Defaults to "div" |
| Return | |
|---|---|
ReactElement |
Plain <div> block with block-level spacing.
- Pass
asto render a different semantic element (section,header,footer,nav,aside,figure).
Examples
<Block><Paragraph>Hello</Paragraph></Block>
<Block as="aside" width="narrow"><Paragraph>Sidebar</Paragraph></Block>