A flexible library for rendering Portable Text content in Astro projects.
Prerequisites:
- Astro (
>=4.6.0) - Node.js (
>=22.12.0)
Installation:
npm install astro-portabletext- Core components for common rich text elements.
- Custom rendering using
slotsor your owncomponents. - Flexible control with the
renderfunction viausePortableText. - Built with TypeScript support.
View live examples:
Sanity has forked astro-portabletext as @portabletext/astro, which is maintained under the @portabletext organization.
If you're already using astro-portabletext, you can continue using it as-is. There is no requirement to migrate.
If you would prefer to use the Sanity-maintained fork, see their migration guide for instructions.
We welcome contributions to improve astro-portabletext!
If you find a bug or have a feature request, please open an issue. If you'd like to contribute code, feel free to submit a pull request.