React Components

React Components

ValProvider

Context provider that enables Val functionality throughout your app.

Props:
config: ValConfig

Configuration object from initVal

children: ReactNode

Child components

Example:
Example
<ValProvider config={config}>
  <App />
</ValProvider>

ValRichText

Rich text component that displays Val rich text content.

Props:
children: RichText

Val rich text content

theme: ValRichTextTheme

Val rich text theme

Example:
Example
<ValRichText theme={{
    bold: "font-bold",
    italic: "italic",
    lineThrough: "underline",
    ul: "list-disc pl-4",
    ol: "list-decimal pl-4",
    }
}>
    {children}
</ValRichText>

ValImage

A wrapper around the NextJS image component which can be used with Val image content.

Props:
src: Image

Val image content

Example:
Example
<ValImage src={image}/>