Skip to content

TextField

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

Table of Contents

Description

The TextField is there to provide your react-components with editable text. It requires you to give it a fieldName and an initValue.

Code

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

const Component = () => {
  return(
      <fields.TextField
        fieldName="sectiontext"
        initValue="<p>Your default text</p>"
        rtf={true}
      />
  )
}

export default Component

Parameters

Property Type Required Description
fieldName string yes The fieldName requires you to give the field an identifier that is unique on that page. It is advisable to use descriptive names for fetching purposes.
initValue string yes The initValue requires a default value for the TextField.
rtf boolean no The rtf property allows you to choose between a RichTextField (true and default) or a more simple TextField (false) for headings etc.

Code Sandbox

Check the TextField out (Replit)