For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
GuidesExamplesChangelog
GuidesExamplesChangelog
  • Code Components
    • Introduction
    • Component Architecture
    • Styling Components
  • Importing Code Components
    • Quick start: Importing code components
    • Installation
    • Define a code component
    • Bundling & Import
  • Generating AI Code Components
    • Quick start: Generating AI code components
  • FAQs
    • FAQs and troubleshooting
  • Reference
    • Webflow CLI
    • Prop Types
      • Text
      • Rich Text
      • Text Node
      • Link
      • Image
      • Number
      • Boolean
      • Variant
      • Visibility
      • Slot
      • ID
LogoLogo
Resources
Get started
On this page
  • Syntax
  • Prop definition
  • Properties
  • Example
  • Prop value
  • Properties
  • Webflow properties panel
  • Example
  • When to use
  • Best practices
ReferenceProp Types

Rich Text

Was this page helpful?
Previous

Text Node

Next
Built with

Add a Rich Text property to your component so designers can create formatted content with HTML markup.

Syntax

1// Prop definition
2props.RichText({
3 name: string,
4 group?: string,
5 tooltip?: string,
6 defaultValue?: string,
7})
8
9// Prop value
10ReactNode

Prop definition

Define the Rich Text prop in your Webflow code component with a name. Optionally, you can add a group and tooltip text.

1props.RichText({
2 name: string,
3 group?: string,
4 tooltip?: string,
5 defaultValue?: string,
6})

Properties

  • name: The name for the property.
  • group: The group for this property. (optional)
  • tooltip: The tooltip for the property. (optional)
  • defaultValue: Default value for all component instances. (optional)

Example

MyComponent.webflow.tsx
1import { declareComponent } from '@webflow/react';
2import { props } from '@webflow/data-types';
3import { MyComponent } from "./MyComponent";
4
5export default declareComponent(MyComponent, {
6 name: "MyComponent",
7 description: "A component with a Rich Text property",
8 props: {
9 content: props.RichText({
10 name: "Content",
11 group: "Content"
12 })
13 }
14});

Prop value

The Rich Text prop provides formatted HTML content to your React component as a ReactNode.

PropType.RichText
1ReactNode

Properties

  • n/a

Webflow properties panel

Rich Text property in the Webflow panel

Example

MyComponent.tsx
1import React from "react";
2
3interface MyComponentProps {
4content?: React.ReactNode;
5}
6
7export const MyComponent = ({ content }: MyComponentProps) => {
8return (
9 <div className="content-wrapper">
10 {content}
11 </div>
12);
13}

When to use

Use a Rich Text prop when you want designers to:

  • Create formatted content with bold, italic, links
  • Add structured content like headings and lists
  • Include HTML markup in their content

Best practices

  • Provide meaningful default values so the component renders when added to the canvas
  • Handle missing content gracefully
  • Consider content styling and layout
  • Test with various HTML structures