What is Portable Text?
Portable Text is Sanity’s rich text format—a structured, JSON-based way to represent content that’s more powerful and flexible than HTML. Unlike HTML (which mixes content and presentation), Portable Text separates what the content is from how it looks. This makes your content:- Platform-agnostic - Render on web, mobile, email, or anywhere
- Structured - Query and filter content programmatically
- Customizable - Style differently across platforms
- Future-proof - Not tied to specific HTML/CSS
Portable Text Structure
Portable Text is an array of blocks and marks:Key Concepts
Blocks
Blocks are the main content units:- Paragraphs -
style: "normal" - Headings -
style: "h1"throughstyle: "h6" - Lists -
listItem: "bullet"orlistItem: "number" - Custom blocks - Images, code, embeds, etc.
Marks
Marks are inline annotations:strong- Bold textem- Italic textunderline- Underlined textcode- Inline codelink- Hyperlinks withhref
Spans
Spans are text segments within blocks, each with its own marks.How MigrateKit Converts HTML
When you migrate from Webflow, MigrateKit transforms HTML to Portable Text:- HTML Input
- Portable Text Output
Benefits for Migration
Preservation of Structure
HTML tags become semantic blocks:| HTML | Portable Text | Benefit |
|---|---|---|
<h2> | style: "h2" | Heading semantics preserved |
<strong> | marks: ["strong"] | Emphasis meaning, not just bold |
<ul><li> | listItem: "bullet" | List structure, not just bullets |
Platform Flexibility
Render Portable Text differently on different platforms:Querying and Filtering
Find content programmatically:Editing Portable Text
In Sanity Studio, Portable Text appears as a rich text editor: Editors see familiar formatting options:- Bold, italic, underline buttons
- Heading dropdown
- List buttons
- Link insertion
- Undo/redo
Custom Block Types
Portable Text isn’t limited to text—you can embed custom content:Why This Matters for Webflow Migrations
From HTML Chaos to Structured Content
Webflow stores rich text as HTML—a mix of content, structure, and styling. Portable Text separates these concerns:| Aspect | HTML (Webflow) | Portable Text (Sanity) |
|---|---|---|
| Content | Mixed with tags | Pure text in children |
| Structure | Implicit in tags | Explicit in _type and style |
| Formatting | CSS classes/inline styles | Semantic marks |
| Portability | Web-specific | Platform-agnostic |
Better Content Management
- Cleaner - No HTML tag soup
- Safer - No script injection risks
- Flexible - Render anywhere, any way
- Searchable - Query content semantically
Common Questions
Can I still use HTML?
Can I still use HTML?
Yes! Sanity supports HTML in Portable Text through custom serializers. But you lose some benefits:
- Can’t query HTML content semantically
- Platform-specific rendering is harder
- Less structured
What if my HTML doesn't convert perfectly?
What if my HTML doesn't convert perfectly?
MigrateKit handles most common HTML tags, but complex structures may need manual cleanup:
- Custom Webflow elements → Code blocks (review in Studio)
- Nested formatting → Simplified to Portable Text rules
- Unsupported tags → Wrapped for safety
Can I edit Portable Text as HTML?
Can I edit Portable Text as HTML?
In Sanity Studio, you edit using the rich text editor (WYSIWYG). To see the raw Portable Text JSON, use Sanity’s Vision plugin.You typically don’t need to edit Portable Text as JSON—the editor handles it.
Is Portable Text a Sanity-specific format?
Is Portable Text a Sanity-specific format?
Portable Text is an open specification created by Sanity. While Sanity uses it extensively, you can use Portable Text in any system. It’s just JSON!