astro-portabletext
Render Portable Text with Astro.
Table of Contents
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 usage. |
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: ,
},
listItem: {
bullet: ,
number: ,
},
mark: {
code: ,
em: ,
link: ,
'strike-through': ,
strong: ,
underline:
},
hardBreak: ,
}
Documentation
See documentation for advanced usage and examples.
License
ISC