https://github.com/theisel/astro-portabletext
A flexible and customizable library for rendering Portable Text content in your Astro projects
https://github.com/theisel/astro-portabletext
astro astro-component portable-text sanity sanity-io typescript withastro
Last synced: 3 months ago
JSON representation
A flexible and customizable library for rendering Portable Text content in your Astro projects
- Host: GitHub
- URL: https://github.com/theisel/astro-portabletext
- Owner: theisel
- License: isc
- Created: 2022-04-27T04:55:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-21T19:59:30.000Z (3 months ago)
- Last Synced: 2025-03-28T07:05:50.009Z (3 months ago)
- Topics: astro, astro-component, portable-text, sanity, sanity-io, typescript, withastro
- Language: Astro
- Homepage: https://www.npmjs.com/package/astro-portabletext
- Size: 1.62 MB
- Stars: 77
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# astro-portabletext
[](https://npmjs.com/package/astro-portabletext)
[](https://npmjs.com/package/astro-portabletext)
A flexible and customizable library for rendering [Portable Text](https://portabletext.org) content in [Astro](https://astro.build) projects.
## 🚀 Features
- **Core components** for common Portable Text elements.
- **Customizable rendering** using `slots` or your own `components`.
- **Flexible control** with the `render` function via `usePortableText`.
- **Built with** TypeScript support.## 🎮 Demonstration
Jump in and see it in action:
## 📖 Resources
- **Installation & usage docs:** [Read the full documentation](docs/README.md)
- **TypeScript types:** [Type definitions](docs/types/README.md)
- **Examples:** [Browse practical examples](examples/README.md)**Versions:**
- [Latest stable version (v0.11.0)](https://github.com/theisel/astro-portabletext/tree/astro-portabletext%400.11.0/astro-portabletext "astro-portabletext v0.10.1 documentation")
- [Development branch](astro-portabletext/README.md "astro-portabletext main branch documentation")##  Sanity Integration
This library is [officially recommended](https://www.sanity.io/plugins/sanity-astro#rendering-rich-text-and-block-content-with-portable-text) by [Sanity](https://sanity.io) for rendering Portable Text in Astro projects.
Helpful resources:
- [Sanity Integration for Astro](https://www.sanity.io/plugins/sanity-astro)
- [Guide: Building a Blog with Sanity and Astro](https://www.sanity.io/guides/sanity-astro-blog)## 🙌 Contributing
We welcome contributions to improve `astro-portabletext`!
If you find a bug or have a feature request, please open an [issue](https://github.com/theisel/astro-portabletext/issues).
If you'd like to contribute code, feel free to submit a [pull request](https://github.com/theisel/astro-portabletext/pulls).## 📄 License
This project is licensed under the [ISC License](https://github.com/theisel/astro-portabletext/blob/main/LICENSE).