-
Notifications
You must be signed in to change notification settings - Fork 3
Blocks
Daniel Petutschnigg edited this page Sep 26, 2021
·
11 revisions
The Block is the keystone of the StreamField. With the help of blocks you can build complex React-Components with editable content.
import {JaenBlock, fields} from '@snek-at/jaen-pages'
const CardBlock: JaenBlock = () => {
return (
<div className="card">
<h1>
<fields.TextField
fieldName="blocktext"
initValue="<p>this is your heading</p>"
rtf={false}
/>
</h1>
<fields.ImageField
fieldName="blockimage"
initValue={{src: 'https://your.source', alt: 'yourAlt'}}
style={{width: '300px', heigth: '180px'}}
/>
</div>
)
}
CardBlock.BlockName = 'CardBlock'
CardBlock.BlockDisplayName = 'Card'
export default CardBlock
WIP