@contentful/live-preview
Preview SDK for both the field tagging connection + live content updates by Contentful.
It uses Typescript, React and is bundled using Vite.
Getting started
Requirements
- Node.js:
>=16.15.1
- Yarn:
>=1.21.1
To install live preview simply run one of the following commands.
yarn add @contentful/live-preview
or
npm install @contentful/live-preview
Documentation
Field Tagging
To tag fields you need to add the live preview data-attributes to the rendered HTML element output.
You can do this in React via our helper function.
import { getLivePreviewProps } from '@contentful/live-preview';
...
<h1 {...getLivePreviewProps({ entryId: id, fieldId: 'title', locale })}>
{title}
</h1>
Live Updates
[Documentation on live updates]
Code of Conduct
We want to provide a safe, inclusive, welcoming, and harassment-free space and experience for all participants, regardless of gender identity and expression, sexual orientation, disability, physical appearance, socioeconomic status, body size, ethnicity, nationality, level of experience, age, religion (or lack thereof), or other identity markers.
Read our full Code of Conduct.
License
The live preview package is open source software licensed as MIT.