[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-sanity-portable-text-serialization":3,"mdc-3pl9gx-key":49,"related-repo-sanity-portable-text-serialization":1084,"related-org-sanity-portable-text-serialization":1187},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":30,"repoUrl":31,"updatedAt":32,"license":33,"forks":34,"topics":35,"repo":44,"sourceUrl":47,"mdContent":48},"portable-text-serialization","serialize Portable Text to frontends","Render and serialize Portable Text to React, Svelte, Vue, Astro, HTML, Markdown, and plain text. Use when implementing Portable Text rendering in any frontend framework, building custom serializers for non-standard block types, converting Portable Text to HTML strings server-side, converting Portable Text to Markdown, extracting plain text from Portable Text, or troubleshooting rendering issues with marks, blocks, lists, or custom types.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"sanity","Sanity","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fsanity.png","sanity-io",[13,17,20,23,26,29],{"name":14,"slug":15,"type":16},"React","react","tag",{"name":18,"slug":19,"type":16},"Vue","vue",{"name":21,"slug":22,"type":16},"HTML","html",{"name":24,"slug":25,"type":16},"CMS","cms",{"name":27,"slug":28,"type":16},"Portable Text","portable-text",{"name":9,"slug":8,"type":16},171,"https:\u002F\u002Fgithub.com\u002Fsanity-io\u002Fagent-toolkit","2026-04-13T05:19:10.157534","MIT",25,[36,37,38,39,40,41,42,43],"agent-rules","ai-rules","claude-code","claude-code-plugin","cursor-ai","mcp","mcp-server","vs-code",{"repoUrl":31,"stars":30,"forks":34,"topics":45,"description":46},[36,37,38,39,40,41,42,43],"Collection of resources to help AI agents build better with Sanity.","https:\u002F\u002Fgithub.com\u002Fsanity-io\u002Fagent-toolkit\u002Ftree\u002FHEAD\u002Fskills\u002Fportable-text-serialization","---\nname: portable-text-serialization\ndescription: Render and serialize Portable Text to React, Svelte, Vue, Astro, HTML, Markdown, and plain text. Use when implementing Portable Text rendering in any frontend framework, building custom serializers for non-standard block types, converting Portable Text to HTML strings server-side, converting Portable Text to Markdown, extracting plain text from Portable Text, or troubleshooting rendering issues with marks, blocks, lists, or custom types.\nlicense: MIT\nmetadata:\n  author: sanity\n  version: \"1.0.0\"\n---\n\n# Portable Text Serialization\n\nRender Portable Text content across frameworks using the `@portabletext\u002F*` library family. Each library follows the same component-mapping pattern: you provide a `components` object that maps PT node types to framework-specific renderers.\n\n## Portable Text Structure (Quick Reference)\n\nPT is an array of blocks. Each block has `_type`, optional `style`, `children` (spans), `markDefs`, `listItem`, and `level`.\n\n```\nRoot array\n├── block (_type: \"block\")\n│   ├── style: \"normal\" | \"h1\" | \"h2\" | \"blockquote\" | ...\n│   ├── children: [span, span, ...]\n│   │   └── span: { _type: \"span\", text: \"...\", marks: [\"strong\", \"\u003CmarkDefKey>\"] }\n│   ├── markDefs: [{ _key, _type: \"link\", href: \"...\" }, ...]\n│   ├── listItem: \"bullet\" | \"number\" (optional)\n│   └── level: 1, 2, 3... (optional, for nested lists)\n├── custom block (_type: \"image\" | \"code\" | any custom type)\n└── ...more blocks\n```\n\n**Marks** come in two forms:\n- **Decorators**: string values in `marks[]` like `\"strong\"`, `\"em\"`, `\"underline\"`, `\"code\"`\n- **Annotations**: keys in `marks[]` referencing entries in `markDefs[]` (e.g., links, internal references)\n\n## Component Mapping Pattern (All Frameworks)\n\nEvery `@portabletext\u002F*` library accepts a `components` object with these keys:\n\n| Key | Renders | Props\u002FData |\n|-----|---------|------------|\n| `types` | Custom block\u002Finline types (image, code, CTA) | `value` (the block data) |\n| `marks` | Decorators + annotations | `children` + `value` (mark data) |\n| `block` | Block styles (h1, normal, blockquote) | `children` |\n| `list` | List wrappers (ul, ol) | `children` |\n| `listItem` | List items | `children` |\n| `hardBreak` | Line breaks within a block | — |\n\n## Framework-Specific Rules\n\nRead the rule file matching your framework:\n\n- **React \u002F Next.js**: `rules\u002Freact.md` — `@portabletext\u002Freact` or `next-sanity`\n- **Svelte \u002F SvelteKit**: `rules\u002Fsvelte.md` — `@portabletext\u002Fsvelte`\n- **Vue \u002F Nuxt**: `rules\u002Fvue.md` — `@portabletext\u002Fvue`\n- **Astro**: `rules\u002Fastro.md` — `astro-portabletext`\n- **HTML (server-side)**: `rules\u002Fhtml.md` — `@portabletext\u002Fto-html`\n- **Markdown**: `rules\u002Fmarkdown.md` — `@portabletext\u002Fmarkdown`\n- **Plain text extraction**: `rules\u002Fplain-text.md` — `@portabletext\u002Ftoolkit`\n\n### Additional Community Serializers\n\nThese are listed on [portabletext.org](https:\u002F\u002Fwww.portabletext.org\u002Fintegrations\u002Fserializers\u002F) but don't have dedicated rule files:\n\n| Target | Package |\n|--------|---------|\n| React Native | `@portabletext\u002Freact-native-portabletext` |\n| React PDF | `@portabletext\u002Freact-pdf-portabletext` |\n| Solid | `solid-portabletext` |\n| Qwik | `portabletext-qwik` |\n| Shopify Liquid | `portable-text-to-liquid` |\n| PHP | `sanity-php` (SanityBlockContent class) |\n| Python | `portabletext-html` |\n| C# \u002F .NET | `dotnet-portable-text` |\n| Dart \u002F Flutter | `flutter_sanity_portable_text` |\n\n## Common Patterns (All Frameworks)\n\n### Custom Types Need Explicit Components\n\nPT renderers only handle standard blocks by default. Custom types (`image`, `code`, `callToAction`, etc.) require explicit component mappings — they won't render otherwise.\n\n### Keep Components Object Stable\n\nIn React\u002FVue, define `components` outside the render function or memoize it. Recreating on every render causes unnecessary re-renders.\n\n### Handle Missing Components Gracefully\n\nAll libraries accept `onMissingComponent` to control behavior when encountering unknown types:\n- `false` — suppress warnings\n- Custom function — log or report\n\n### Querying PT with GROQ\n\nAlways expand references inside custom blocks:\n\n```groq\nbody[]{\n  ...,\n  _type == \"image\" => {\n    ...,\n    asset->\n  },\n  markDefs[]{\n    ...,\n    _type == \"internalLink\" => {\n      ...,\n      \"slug\": @.reference->slug.current\n    }\n  }\n}\n```\n",{"data":50,"body":53},{"name":4,"description":6,"license":33,"metadata":51},{"author":8,"version":52},"1.0.0",{"type":54,"children":55},"root",[56,64,87,94,146,158,169,244,250,269,460,466,471,638,645,661,838,844,850,876,882,894,900,913,932,938,943,1079],{"type":57,"tag":58,"props":59,"children":60},"element","h1",{"id":4},[61],{"type":62,"value":63},"text","Portable Text Serialization",{"type":57,"tag":65,"props":66,"children":67},"p",{},[68,70,77,79,85],{"type":62,"value":69},"Render Portable Text content across frameworks using the ",{"type":57,"tag":71,"props":72,"children":74},"code",{"className":73},[],[75],{"type":62,"value":76},"@portabletext\u002F*",{"type":62,"value":78}," library family. Each library follows the same component-mapping pattern: you provide a ",{"type":57,"tag":71,"props":80,"children":82},{"className":81},[],[83],{"type":62,"value":84},"components",{"type":62,"value":86}," object that maps PT node types to framework-specific renderers.",{"type":57,"tag":88,"props":89,"children":91},"h2",{"id":90},"portable-text-structure-quick-reference",[92],{"type":62,"value":93},"Portable Text Structure (Quick Reference)",{"type":57,"tag":65,"props":95,"children":96},{},[97,99,105,107,113,115,121,123,129,130,136,138,144],{"type":62,"value":98},"PT is an array of blocks. Each block has ",{"type":57,"tag":71,"props":100,"children":102},{"className":101},[],[103],{"type":62,"value":104},"_type",{"type":62,"value":106},", optional ",{"type":57,"tag":71,"props":108,"children":110},{"className":109},[],[111],{"type":62,"value":112},"style",{"type":62,"value":114},", ",{"type":57,"tag":71,"props":116,"children":118},{"className":117},[],[119],{"type":62,"value":120},"children",{"type":62,"value":122}," (spans), ",{"type":57,"tag":71,"props":124,"children":126},{"className":125},[],[127],{"type":62,"value":128},"markDefs",{"type":62,"value":114},{"type":57,"tag":71,"props":131,"children":133},{"className":132},[],[134],{"type":62,"value":135},"listItem",{"type":62,"value":137},", and ",{"type":57,"tag":71,"props":139,"children":141},{"className":140},[],[142],{"type":62,"value":143},"level",{"type":62,"value":145},".",{"type":57,"tag":147,"props":148,"children":152},"pre",{"className":149,"code":151,"language":62},[150],"language-text","Root array\n├── block (_type: \"block\")\n│   ├── style: \"normal\" | \"h1\" | \"h2\" | \"blockquote\" | ...\n│   ├── children: [span, span, ...]\n│   │   └── span: { _type: \"span\", text: \"...\", marks: [\"strong\", \"\u003CmarkDefKey>\"] }\n│   ├── markDefs: [{ _key, _type: \"link\", href: \"...\" }, ...]\n│   ├── listItem: \"bullet\" | \"number\" (optional)\n│   └── level: 1, 2, 3... (optional, for nested lists)\n├── custom block (_type: \"image\" | \"code\" | any custom type)\n└── ...more blocks\n",[153],{"type":57,"tag":71,"props":154,"children":156},{"__ignoreMap":155},"",[157],{"type":62,"value":151},{"type":57,"tag":65,"props":159,"children":160},{},[161,167],{"type":57,"tag":162,"props":163,"children":164},"strong",{},[165],{"type":62,"value":166},"Marks",{"type":62,"value":168}," come in two forms:",{"type":57,"tag":170,"props":171,"children":172},"ul",{},[173,219],{"type":57,"tag":174,"props":175,"children":176},"li",{},[177,182,184,190,192,198,199,205,206,212,213],{"type":57,"tag":162,"props":178,"children":179},{},[180],{"type":62,"value":181},"Decorators",{"type":62,"value":183},": string values in ",{"type":57,"tag":71,"props":185,"children":187},{"className":186},[],[188],{"type":62,"value":189},"marks[]",{"type":62,"value":191}," like ",{"type":57,"tag":71,"props":193,"children":195},{"className":194},[],[196],{"type":62,"value":197},"\"strong\"",{"type":62,"value":114},{"type":57,"tag":71,"props":200,"children":202},{"className":201},[],[203],{"type":62,"value":204},"\"em\"",{"type":62,"value":114},{"type":57,"tag":71,"props":207,"children":209},{"className":208},[],[210],{"type":62,"value":211},"\"underline\"",{"type":62,"value":114},{"type":57,"tag":71,"props":214,"children":216},{"className":215},[],[217],{"type":62,"value":218},"\"code\"",{"type":57,"tag":174,"props":220,"children":221},{},[222,227,229,234,236,242],{"type":57,"tag":162,"props":223,"children":224},{},[225],{"type":62,"value":226},"Annotations",{"type":62,"value":228},": keys in ",{"type":57,"tag":71,"props":230,"children":232},{"className":231},[],[233],{"type":62,"value":189},{"type":62,"value":235}," referencing entries in ",{"type":57,"tag":71,"props":237,"children":239},{"className":238},[],[240],{"type":62,"value":241},"markDefs[]",{"type":62,"value":243}," (e.g., links, internal references)",{"type":57,"tag":88,"props":245,"children":247},{"id":246},"component-mapping-pattern-all-frameworks",[248],{"type":62,"value":249},"Component Mapping Pattern (All Frameworks)",{"type":57,"tag":65,"props":251,"children":252},{},[253,255,260,262,267],{"type":62,"value":254},"Every ",{"type":57,"tag":71,"props":256,"children":258},{"className":257},[],[259],{"type":62,"value":76},{"type":62,"value":261}," library accepts a ",{"type":57,"tag":71,"props":263,"children":265},{"className":264},[],[266],{"type":62,"value":84},{"type":62,"value":268}," object with these keys:",{"type":57,"tag":270,"props":271,"children":272},"table",{},[273,297],{"type":57,"tag":274,"props":275,"children":276},"thead",{},[277],{"type":57,"tag":278,"props":279,"children":280},"tr",{},[281,287,292],{"type":57,"tag":282,"props":283,"children":284},"th",{},[285],{"type":62,"value":286},"Key",{"type":57,"tag":282,"props":288,"children":289},{},[290],{"type":62,"value":291},"Renders",{"type":57,"tag":282,"props":293,"children":294},{},[295],{"type":62,"value":296},"Props\u002FData",{"type":57,"tag":298,"props":299,"children":300},"tbody",{},[301,330,364,389,414,438],{"type":57,"tag":278,"props":302,"children":303},{},[304,314,319],{"type":57,"tag":305,"props":306,"children":307},"td",{},[308],{"type":57,"tag":71,"props":309,"children":311},{"className":310},[],[312],{"type":62,"value":313},"types",{"type":57,"tag":305,"props":315,"children":316},{},[317],{"type":62,"value":318},"Custom block\u002Finline types (image, code, CTA)",{"type":57,"tag":305,"props":320,"children":321},{},[322,328],{"type":57,"tag":71,"props":323,"children":325},{"className":324},[],[326],{"type":62,"value":327},"value",{"type":62,"value":329}," (the block data)",{"type":57,"tag":278,"props":331,"children":332},{},[333,342,347],{"type":57,"tag":305,"props":334,"children":335},{},[336],{"type":57,"tag":71,"props":337,"children":339},{"className":338},[],[340],{"type":62,"value":341},"marks",{"type":57,"tag":305,"props":343,"children":344},{},[345],{"type":62,"value":346},"Decorators + annotations",{"type":57,"tag":305,"props":348,"children":349},{},[350,355,357,362],{"type":57,"tag":71,"props":351,"children":353},{"className":352},[],[354],{"type":62,"value":120},{"type":62,"value":356}," + ",{"type":57,"tag":71,"props":358,"children":360},{"className":359},[],[361],{"type":62,"value":327},{"type":62,"value":363}," (mark data)",{"type":57,"tag":278,"props":365,"children":366},{},[367,376,381],{"type":57,"tag":305,"props":368,"children":369},{},[370],{"type":57,"tag":71,"props":371,"children":373},{"className":372},[],[374],{"type":62,"value":375},"block",{"type":57,"tag":305,"props":377,"children":378},{},[379],{"type":62,"value":380},"Block styles (h1, normal, blockquote)",{"type":57,"tag":305,"props":382,"children":383},{},[384],{"type":57,"tag":71,"props":385,"children":387},{"className":386},[],[388],{"type":62,"value":120},{"type":57,"tag":278,"props":390,"children":391},{},[392,401,406],{"type":57,"tag":305,"props":393,"children":394},{},[395],{"type":57,"tag":71,"props":396,"children":398},{"className":397},[],[399],{"type":62,"value":400},"list",{"type":57,"tag":305,"props":402,"children":403},{},[404],{"type":62,"value":405},"List wrappers (ul, ol)",{"type":57,"tag":305,"props":407,"children":408},{},[409],{"type":57,"tag":71,"props":410,"children":412},{"className":411},[],[413],{"type":62,"value":120},{"type":57,"tag":278,"props":415,"children":416},{},[417,425,430],{"type":57,"tag":305,"props":418,"children":419},{},[420],{"type":57,"tag":71,"props":421,"children":423},{"className":422},[],[424],{"type":62,"value":135},{"type":57,"tag":305,"props":426,"children":427},{},[428],{"type":62,"value":429},"List items",{"type":57,"tag":305,"props":431,"children":432},{},[433],{"type":57,"tag":71,"props":434,"children":436},{"className":435},[],[437],{"type":62,"value":120},{"type":57,"tag":278,"props":439,"children":440},{},[441,450,455],{"type":57,"tag":305,"props":442,"children":443},{},[444],{"type":57,"tag":71,"props":445,"children":447},{"className":446},[],[448],{"type":62,"value":449},"hardBreak",{"type":57,"tag":305,"props":451,"children":452},{},[453],{"type":62,"value":454},"Line breaks within a block",{"type":57,"tag":305,"props":456,"children":457},{},[458],{"type":62,"value":459},"—",{"type":57,"tag":88,"props":461,"children":463},{"id":462},"framework-specific-rules",[464],{"type":62,"value":465},"Framework-Specific Rules",{"type":57,"tag":65,"props":467,"children":468},{},[469],{"type":62,"value":470},"Read the rule file matching your framework:",{"type":57,"tag":170,"props":472,"children":473},{},[474,506,528,550,572,594,616],{"type":57,"tag":174,"props":475,"children":476},{},[477,482,484,490,492,498,500],{"type":57,"tag":162,"props":478,"children":479},{},[480],{"type":62,"value":481},"React \u002F Next.js",{"type":62,"value":483},": ",{"type":57,"tag":71,"props":485,"children":487},{"className":486},[],[488],{"type":62,"value":489},"rules\u002Freact.md",{"type":62,"value":491}," — ",{"type":57,"tag":71,"props":493,"children":495},{"className":494},[],[496],{"type":62,"value":497},"@portabletext\u002Freact",{"type":62,"value":499}," or ",{"type":57,"tag":71,"props":501,"children":503},{"className":502},[],[504],{"type":62,"value":505},"next-sanity",{"type":57,"tag":174,"props":507,"children":508},{},[509,514,515,521,522],{"type":57,"tag":162,"props":510,"children":511},{},[512],{"type":62,"value":513},"Svelte \u002F SvelteKit",{"type":62,"value":483},{"type":57,"tag":71,"props":516,"children":518},{"className":517},[],[519],{"type":62,"value":520},"rules\u002Fsvelte.md",{"type":62,"value":491},{"type":57,"tag":71,"props":523,"children":525},{"className":524},[],[526],{"type":62,"value":527},"@portabletext\u002Fsvelte",{"type":57,"tag":174,"props":529,"children":530},{},[531,536,537,543,544],{"type":57,"tag":162,"props":532,"children":533},{},[534],{"type":62,"value":535},"Vue \u002F Nuxt",{"type":62,"value":483},{"type":57,"tag":71,"props":538,"children":540},{"className":539},[],[541],{"type":62,"value":542},"rules\u002Fvue.md",{"type":62,"value":491},{"type":57,"tag":71,"props":545,"children":547},{"className":546},[],[548],{"type":62,"value":549},"@portabletext\u002Fvue",{"type":57,"tag":174,"props":551,"children":552},{},[553,558,559,565,566],{"type":57,"tag":162,"props":554,"children":555},{},[556],{"type":62,"value":557},"Astro",{"type":62,"value":483},{"type":57,"tag":71,"props":560,"children":562},{"className":561},[],[563],{"type":62,"value":564},"rules\u002Fastro.md",{"type":62,"value":491},{"type":57,"tag":71,"props":567,"children":569},{"className":568},[],[570],{"type":62,"value":571},"astro-portabletext",{"type":57,"tag":174,"props":573,"children":574},{},[575,580,581,587,588],{"type":57,"tag":162,"props":576,"children":577},{},[578],{"type":62,"value":579},"HTML (server-side)",{"type":62,"value":483},{"type":57,"tag":71,"props":582,"children":584},{"className":583},[],[585],{"type":62,"value":586},"rules\u002Fhtml.md",{"type":62,"value":491},{"type":57,"tag":71,"props":589,"children":591},{"className":590},[],[592],{"type":62,"value":593},"@portabletext\u002Fto-html",{"type":57,"tag":174,"props":595,"children":596},{},[597,602,603,609,610],{"type":57,"tag":162,"props":598,"children":599},{},[600],{"type":62,"value":601},"Markdown",{"type":62,"value":483},{"type":57,"tag":71,"props":604,"children":606},{"className":605},[],[607],{"type":62,"value":608},"rules\u002Fmarkdown.md",{"type":62,"value":491},{"type":57,"tag":71,"props":611,"children":613},{"className":612},[],[614],{"type":62,"value":615},"@portabletext\u002Fmarkdown",{"type":57,"tag":174,"props":617,"children":618},{},[619,624,625,631,632],{"type":57,"tag":162,"props":620,"children":621},{},[622],{"type":62,"value":623},"Plain text extraction",{"type":62,"value":483},{"type":57,"tag":71,"props":626,"children":628},{"className":627},[],[629],{"type":62,"value":630},"rules\u002Fplain-text.md",{"type":62,"value":491},{"type":57,"tag":71,"props":633,"children":635},{"className":634},[],[636],{"type":62,"value":637},"@portabletext\u002Ftoolkit",{"type":57,"tag":639,"props":640,"children":642},"h3",{"id":641},"additional-community-serializers",[643],{"type":62,"value":644},"Additional Community Serializers",{"type":57,"tag":65,"props":646,"children":647},{},[648,650,659],{"type":62,"value":649},"These are listed on ",{"type":57,"tag":651,"props":652,"children":656},"a",{"href":653,"rel":654},"https:\u002F\u002Fwww.portabletext.org\u002Fintegrations\u002Fserializers\u002F",[655],"nofollow",[657],{"type":62,"value":658},"portabletext.org",{"type":62,"value":660}," but don't have dedicated rule files:",{"type":57,"tag":270,"props":662,"children":663},{},[664,680],{"type":57,"tag":274,"props":665,"children":666},{},[667],{"type":57,"tag":278,"props":668,"children":669},{},[670,675],{"type":57,"tag":282,"props":671,"children":672},{},[673],{"type":62,"value":674},"Target",{"type":57,"tag":282,"props":676,"children":677},{},[678],{"type":62,"value":679},"Package",{"type":57,"tag":298,"props":681,"children":682},{},[683,700,717,734,751,768,787,804,821],{"type":57,"tag":278,"props":684,"children":685},{},[686,691],{"type":57,"tag":305,"props":687,"children":688},{},[689],{"type":62,"value":690},"React Native",{"type":57,"tag":305,"props":692,"children":693},{},[694],{"type":57,"tag":71,"props":695,"children":697},{"className":696},[],[698],{"type":62,"value":699},"@portabletext\u002Freact-native-portabletext",{"type":57,"tag":278,"props":701,"children":702},{},[703,708],{"type":57,"tag":305,"props":704,"children":705},{},[706],{"type":62,"value":707},"React PDF",{"type":57,"tag":305,"props":709,"children":710},{},[711],{"type":57,"tag":71,"props":712,"children":714},{"className":713},[],[715],{"type":62,"value":716},"@portabletext\u002Freact-pdf-portabletext",{"type":57,"tag":278,"props":718,"children":719},{},[720,725],{"type":57,"tag":305,"props":721,"children":722},{},[723],{"type":62,"value":724},"Solid",{"type":57,"tag":305,"props":726,"children":727},{},[728],{"type":57,"tag":71,"props":729,"children":731},{"className":730},[],[732],{"type":62,"value":733},"solid-portabletext",{"type":57,"tag":278,"props":735,"children":736},{},[737,742],{"type":57,"tag":305,"props":738,"children":739},{},[740],{"type":62,"value":741},"Qwik",{"type":57,"tag":305,"props":743,"children":744},{},[745],{"type":57,"tag":71,"props":746,"children":748},{"className":747},[],[749],{"type":62,"value":750},"portabletext-qwik",{"type":57,"tag":278,"props":752,"children":753},{},[754,759],{"type":57,"tag":305,"props":755,"children":756},{},[757],{"type":62,"value":758},"Shopify Liquid",{"type":57,"tag":305,"props":760,"children":761},{},[762],{"type":57,"tag":71,"props":763,"children":765},{"className":764},[],[766],{"type":62,"value":767},"portable-text-to-liquid",{"type":57,"tag":278,"props":769,"children":770},{},[771,776],{"type":57,"tag":305,"props":772,"children":773},{},[774],{"type":62,"value":775},"PHP",{"type":57,"tag":305,"props":777,"children":778},{},[779,785],{"type":57,"tag":71,"props":780,"children":782},{"className":781},[],[783],{"type":62,"value":784},"sanity-php",{"type":62,"value":786}," (SanityBlockContent class)",{"type":57,"tag":278,"props":788,"children":789},{},[790,795],{"type":57,"tag":305,"props":791,"children":792},{},[793],{"type":62,"value":794},"Python",{"type":57,"tag":305,"props":796,"children":797},{},[798],{"type":57,"tag":71,"props":799,"children":801},{"className":800},[],[802],{"type":62,"value":803},"portabletext-html",{"type":57,"tag":278,"props":805,"children":806},{},[807,812],{"type":57,"tag":305,"props":808,"children":809},{},[810],{"type":62,"value":811},"C# \u002F .NET",{"type":57,"tag":305,"props":813,"children":814},{},[815],{"type":57,"tag":71,"props":816,"children":818},{"className":817},[],[819],{"type":62,"value":820},"dotnet-portable-text",{"type":57,"tag":278,"props":822,"children":823},{},[824,829],{"type":57,"tag":305,"props":825,"children":826},{},[827],{"type":62,"value":828},"Dart \u002F Flutter",{"type":57,"tag":305,"props":830,"children":831},{},[832],{"type":57,"tag":71,"props":833,"children":835},{"className":834},[],[836],{"type":62,"value":837},"flutter_sanity_portable_text",{"type":57,"tag":88,"props":839,"children":841},{"id":840},"common-patterns-all-frameworks",[842],{"type":62,"value":843},"Common Patterns (All Frameworks)",{"type":57,"tag":639,"props":845,"children":847},{"id":846},"custom-types-need-explicit-components",[848],{"type":62,"value":849},"Custom Types Need Explicit Components",{"type":57,"tag":65,"props":851,"children":852},{},[853,855,861,862,867,868,874],{"type":62,"value":854},"PT renderers only handle standard blocks by default. Custom types (",{"type":57,"tag":71,"props":856,"children":858},{"className":857},[],[859],{"type":62,"value":860},"image",{"type":62,"value":114},{"type":57,"tag":71,"props":863,"children":865},{"className":864},[],[866],{"type":62,"value":71},{"type":62,"value":114},{"type":57,"tag":71,"props":869,"children":871},{"className":870},[],[872],{"type":62,"value":873},"callToAction",{"type":62,"value":875},", etc.) require explicit component mappings — they won't render otherwise.",{"type":57,"tag":639,"props":877,"children":879},{"id":878},"keep-components-object-stable",[880],{"type":62,"value":881},"Keep Components Object Stable",{"type":57,"tag":65,"props":883,"children":884},{},[885,887,892],{"type":62,"value":886},"In React\u002FVue, define ",{"type":57,"tag":71,"props":888,"children":890},{"className":889},[],[891],{"type":62,"value":84},{"type":62,"value":893}," outside the render function or memoize it. Recreating on every render causes unnecessary re-renders.",{"type":57,"tag":639,"props":895,"children":897},{"id":896},"handle-missing-components-gracefully",[898],{"type":62,"value":899},"Handle Missing Components Gracefully",{"type":57,"tag":65,"props":901,"children":902},{},[903,905,911],{"type":62,"value":904},"All libraries accept ",{"type":57,"tag":71,"props":906,"children":908},{"className":907},[],[909],{"type":62,"value":910},"onMissingComponent",{"type":62,"value":912}," to control behavior when encountering unknown types:",{"type":57,"tag":170,"props":914,"children":915},{},[916,927],{"type":57,"tag":174,"props":917,"children":918},{},[919,925],{"type":57,"tag":71,"props":920,"children":922},{"className":921},[],[923],{"type":62,"value":924},"false",{"type":62,"value":926}," — suppress warnings",{"type":57,"tag":174,"props":928,"children":929},{},[930],{"type":62,"value":931},"Custom function — log or report",{"type":57,"tag":639,"props":933,"children":935},{"id":934},"querying-pt-with-groq",[936],{"type":62,"value":937},"Querying PT with GROQ",{"type":57,"tag":65,"props":939,"children":940},{},[941],{"type":62,"value":942},"Always expand references inside custom blocks:",{"type":57,"tag":147,"props":944,"children":948},{"className":945,"code":946,"language":947,"meta":155,"style":155},"language-groq shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","body[]{\n  ...,\n  _type == \"image\" => {\n    ...,\n    asset->\n  },\n  markDefs[]{\n    ...,\n    _type == \"internalLink\" => {\n      ...,\n      \"slug\": @.reference->slug.current\n    }\n  }\n}\n","groq",[949],{"type":57,"tag":71,"props":950,"children":951},{"__ignoreMap":155},[952,963,972,981,990,999,1008,1017,1025,1034,1043,1052,1061,1070],{"type":57,"tag":953,"props":954,"children":957},"span",{"class":955,"line":956},"line",1,[958],{"type":57,"tag":953,"props":959,"children":960},{},[961],{"type":62,"value":962},"body[]{\n",{"type":57,"tag":953,"props":964,"children":966},{"class":955,"line":965},2,[967],{"type":57,"tag":953,"props":968,"children":969},{},[970],{"type":62,"value":971},"  ...,\n",{"type":57,"tag":953,"props":973,"children":975},{"class":955,"line":974},3,[976],{"type":57,"tag":953,"props":977,"children":978},{},[979],{"type":62,"value":980},"  _type == \"image\" => {\n",{"type":57,"tag":953,"props":982,"children":984},{"class":955,"line":983},4,[985],{"type":57,"tag":953,"props":986,"children":987},{},[988],{"type":62,"value":989},"    ...,\n",{"type":57,"tag":953,"props":991,"children":993},{"class":955,"line":992},5,[994],{"type":57,"tag":953,"props":995,"children":996},{},[997],{"type":62,"value":998},"    asset->\n",{"type":57,"tag":953,"props":1000,"children":1002},{"class":955,"line":1001},6,[1003],{"type":57,"tag":953,"props":1004,"children":1005},{},[1006],{"type":62,"value":1007},"  },\n",{"type":57,"tag":953,"props":1009,"children":1011},{"class":955,"line":1010},7,[1012],{"type":57,"tag":953,"props":1013,"children":1014},{},[1015],{"type":62,"value":1016},"  markDefs[]{\n",{"type":57,"tag":953,"props":1018,"children":1020},{"class":955,"line":1019},8,[1021],{"type":57,"tag":953,"props":1022,"children":1023},{},[1024],{"type":62,"value":989},{"type":57,"tag":953,"props":1026,"children":1028},{"class":955,"line":1027},9,[1029],{"type":57,"tag":953,"props":1030,"children":1031},{},[1032],{"type":62,"value":1033},"    _type == \"internalLink\" => {\n",{"type":57,"tag":953,"props":1035,"children":1037},{"class":955,"line":1036},10,[1038],{"type":57,"tag":953,"props":1039,"children":1040},{},[1041],{"type":62,"value":1042},"      ...,\n",{"type":57,"tag":953,"props":1044,"children":1046},{"class":955,"line":1045},11,[1047],{"type":57,"tag":953,"props":1048,"children":1049},{},[1050],{"type":62,"value":1051},"      \"slug\": @.reference->slug.current\n",{"type":57,"tag":953,"props":1053,"children":1055},{"class":955,"line":1054},12,[1056],{"type":57,"tag":953,"props":1057,"children":1058},{},[1059],{"type":62,"value":1060},"    }\n",{"type":57,"tag":953,"props":1062,"children":1064},{"class":955,"line":1063},13,[1065],{"type":57,"tag":953,"props":1066,"children":1067},{},[1068],{"type":62,"value":1069},"  }\n",{"type":57,"tag":953,"props":1071,"children":1073},{"class":955,"line":1072},14,[1074],{"type":57,"tag":953,"props":1075,"children":1076},{},[1077],{"type":62,"value":1078},"}\n",{"type":57,"tag":112,"props":1080,"children":1081},{},[1082],{"type":62,"value":1083},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1085,"total":1010},[1086,1103,1121,1132,1141,1159,1174],{"slug":1087,"name":1087,"fn":1088,"description":1089,"org":1090,"tags":1091,"stars":30,"repoUrl":31,"updatedAt":1102},"content-experimentation-best-practices","design and analyze content experiments","Content experimentation and A\u002FB testing guidance covering experiment design, hypotheses, metrics, sample size, statistical foundations, CMS-managed variants, and common analysis pitfalls. Use this skill when planning experiments, setting up variants, choosing success metrics, interpreting statistical results, or building experimentation workflows in a CMS or frontend stack.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1092,1095,1098,1101],{"name":1093,"slug":1094,"type":16},"A\u002FB Testing","a-b-testing",{"name":1096,"slug":1097,"type":16},"Analytics","analytics",{"name":1099,"slug":1100,"type":16},"Marketing","marketing",{"name":9,"slug":8,"type":16},"2026-04-06T18:52:37.188766",{"slug":1104,"name":1104,"fn":1105,"description":1106,"org":1107,"tags":1108,"stars":30,"repoUrl":31,"updatedAt":1120},"content-modeling-best-practices","apply structured content modeling practices","Structured content modeling guidance for schema design, content architecture, content reuse, references versus embedded objects, separation of concerns, and taxonomies across Sanity and other headless CMSes. Use this skill when designing or refactoring content types, deciding field shapes, debating reusable versus nested content, planning omnichannel content models, or reviewing whether a schema is too page-shaped or presentation-driven.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1109,1112,1113,1116,1119],{"name":1110,"slug":1111,"type":16},"Architecture","architecture",{"name":24,"slug":25,"type":16},{"name":1114,"slug":1115,"type":16},"Data Modeling","data-modeling",{"name":1117,"slug":1118,"type":16},"Design","design",{"name":9,"slug":8,"type":16},"2026-04-06T18:52:35.944096",{"slug":1122,"name":1122,"fn":1123,"description":1124,"org":1125,"tags":1126,"stars":30,"repoUrl":31,"updatedAt":1131},"portable-text-conversion","convert content to Portable Text","Convert HTML and Markdown content into Portable Text blocks for Sanity. Use when migrating content from legacy CMSs, importing HTML or Markdown into Sanity, building content pipelines that ingest external content, converting rich text between formats, or programmatically creating Portable Text documents. Covers @portabletext\u002Fmarkdown (markdownToPortableText), @portabletext\u002Fblock-tools (htmlToBlocks), custom deserializers, and the Portable Text specification for manual block construction.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1127,1128,1129,1130],{"name":24,"slug":25,"type":16},{"name":21,"slug":22,"type":16},{"name":27,"slug":28,"type":16},{"name":9,"slug":8,"type":16},"2026-04-13T05:19:08.919337",{"slug":4,"name":4,"fn":5,"description":6,"org":1133,"tags":1134,"stars":30,"repoUrl":31,"updatedAt":32},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1135,1136,1137,1138,1139,1140],{"name":24,"slug":25,"type":16},{"name":21,"slug":22,"type":16},{"name":27,"slug":28,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},{"slug":1142,"name":1142,"fn":1143,"description":1144,"org":1145,"tags":1146,"stars":30,"repoUrl":31,"updatedAt":1158},"sanity-best-practices","apply Sanity development best practices","Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, webhooks, Blueprints, and framework integrations such as Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen, and the App SDK. Use this skill whenever working with Sanity schemas, defineType or defineField, GROQ or defineQuery, content modeling, Presentation or preview setups, Sanity-powered frontend integrations, event-driven content automation, documentEventHandler, defineDocumentFunction, defineMediaLibraryAssetFunction, @sanity\u002Ffunctions, @sanity\u002Fblueprints, sanity.blueprint.ts, event-driven content automation, or when reviewing and fixing a Sanity codebase.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1147,1148,1151,1154,1155],{"name":24,"slug":25,"type":16},{"name":1149,"slug":1150,"type":16},"Frontend","frontend",{"name":1152,"slug":1153,"type":16},"Next.js","next-js",{"name":9,"slug":8,"type":16},{"name":1156,"slug":1157,"type":16},"TypeScript","typescript","2026-07-30T05:31:41.586173",{"slug":1160,"name":1160,"fn":1161,"description":1162,"org":1163,"tags":1164,"stars":30,"repoUrl":31,"updatedAt":1173},"sanity-migration","migrate content from other CMSes to Sanity","Plans, implements, and reviews migrations from other CMSes and content systems into Sanity. Use when migrating or replatforming to Sanity from AEM, Adobe Experience Manager, Contentful, Strapi, Webflow, WordPress, Payload, Drupal, Markdown\u002FMDX\u002Ffrontmatter files, WXR\u002FXML exports, CMS APIs, database dumps, static HTML, or when designing extraction, transformation, Portable Text conversion, asset migration, redirects, validation, and cutover workflows.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1165,1166,1169,1172],{"name":24,"slug":25,"type":16},{"name":1167,"slug":1168,"type":16},"Content Strategy","content-strategy",{"name":1170,"slug":1171,"type":16},"Migration","migration",{"name":9,"slug":8,"type":16},"2026-07-30T05:31:40.656418",{"slug":1175,"name":1175,"fn":1176,"description":1177,"org":1178,"tags":1179,"stars":30,"repoUrl":31,"updatedAt":1186},"seo-aeo-best-practices","implement SEO and AEO best practices","SEO and AEO best practices for metadata, Open Graph, sitemaps, robots.txt, hreflang, JSON-LD structured data, EEAT, and content optimized for search engines and AI answer surfaces. Use this skill when implementing page SEO, technical SEO, schema markup, international SEO, AI-overview readiness, or improving content for Google, ChatGPT, Perplexity, and similar assistants.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1180,1181,1182,1183],{"name":1167,"slug":1168,"type":16},{"name":1099,"slug":1100,"type":16},{"name":9,"slug":8,"type":16},{"name":1184,"slug":1185,"type":16},"SEO","seo","2026-04-06T18:52:34.660246",{"items":1188,"total":1010},[1189,1196,1204,1211,1220,1228,1235],{"slug":1087,"name":1087,"fn":1088,"description":1089,"org":1190,"tags":1191,"stars":30,"repoUrl":31,"updatedAt":1102},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1192,1193,1194,1195],{"name":1093,"slug":1094,"type":16},{"name":1096,"slug":1097,"type":16},{"name":1099,"slug":1100,"type":16},{"name":9,"slug":8,"type":16},{"slug":1104,"name":1104,"fn":1105,"description":1106,"org":1197,"tags":1198,"stars":30,"repoUrl":31,"updatedAt":1120},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1199,1200,1201,1202,1203],{"name":1110,"slug":1111,"type":16},{"name":24,"slug":25,"type":16},{"name":1114,"slug":1115,"type":16},{"name":1117,"slug":1118,"type":16},{"name":9,"slug":8,"type":16},{"slug":1122,"name":1122,"fn":1123,"description":1124,"org":1205,"tags":1206,"stars":30,"repoUrl":31,"updatedAt":1131},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1207,1208,1209,1210],{"name":24,"slug":25,"type":16},{"name":21,"slug":22,"type":16},{"name":27,"slug":28,"type":16},{"name":9,"slug":8,"type":16},{"slug":4,"name":4,"fn":5,"description":6,"org":1212,"tags":1213,"stars":30,"repoUrl":31,"updatedAt":32},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1214,1215,1216,1217,1218,1219],{"name":24,"slug":25,"type":16},{"name":21,"slug":22,"type":16},{"name":27,"slug":28,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},{"slug":1142,"name":1142,"fn":1143,"description":1144,"org":1221,"tags":1222,"stars":30,"repoUrl":31,"updatedAt":1158},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1223,1224,1225,1226,1227],{"name":24,"slug":25,"type":16},{"name":1149,"slug":1150,"type":16},{"name":1152,"slug":1153,"type":16},{"name":9,"slug":8,"type":16},{"name":1156,"slug":1157,"type":16},{"slug":1160,"name":1160,"fn":1161,"description":1162,"org":1229,"tags":1230,"stars":30,"repoUrl":31,"updatedAt":1173},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1231,1232,1233,1234],{"name":24,"slug":25,"type":16},{"name":1167,"slug":1168,"type":16},{"name":1170,"slug":1171,"type":16},{"name":9,"slug":8,"type":16},{"slug":1175,"name":1175,"fn":1176,"description":1177,"org":1236,"tags":1237,"stars":30,"repoUrl":31,"updatedAt":1186},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1238,1239,1240,1241],{"name":1167,"slug":1168,"type":16},{"name":1099,"slug":1100,"type":16},{"name":9,"slug":8,"type":16},{"name":1184,"slug":1185,"type":16}]