Skip to content

ImageField

Daniel Petutschnigg edited this page Sep 26, 2021 · 8 revisions

Table of Contents

Description

The ImageField is your Jaen-option for embedding images hosted on the ipfs.

Code

import { fields } from "@snek-at/jaen-pages";

const Component = () => {
  return (
    <fields.ImageField
      fieldName="component-img"
      initValue={{
        src: 'https://your.source',
        alt: 'imagealt'
      }}
    />
  )
}

export default Component

Parameters

Property Type Required Description
fieldName string yes The fieldName requires you to name your field. The name has to be unique on the page. It is advisable to use descriptive names.
initValue object yes The initValue requires you to set a default image. For this purpose you have an object with the keys src, alt and optionally title. {src: string, title: string, alt: string}

Code Sandbox

Check the ImageField out (Replit)