astro-portabletext

Render Portable Text with Astro.

Table of Contents
Getting Started
Install
$ npm install astro-portabletext
Usage
Import | Description |
---|
astro-portabletext | For PortableText component. See PortableText Component for details. |
astro-portabletext/components | For Block , List , ListItem and Mark components. See Extending Components for details. |
astro-portabletext/types | For Typescript types |
astro-portabletext/utils | For utility functions |
---
import { PortableText } from "astro-portabletext";
---
<PortableText
value=/* Required */
components=/* Optional */
onMissingComponent=/* Optional */
listNestingMode=/* Optional */
/>
astro-portabletext components will render the following:
{
type: {
},
block: {
h1: ,
h2: ,
h3: ,
h4: ,
h5: ,
h6: ,
blockquote: ,
normal:
},
list: {
bullet: ,
number: ,
menu: ,
},
listItem: {
bullet: ,
number: ,
menu: ,
},
mark: {
code: ,
em: ,
link: ,
'strike-through': ,
strong: ,
underline:
},
hardBreak: ,
}
Documentation
Refer to docs page for advanced usage and examples.
Sanity Projects
Refer to astro-portabletext
Sanity docs page
License
ISC