An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        


astro-portabletext logo

# astro-portabletext

[![npm version](https://img.shields.io/npm/v/astro-portabletext.svg?style=flat-square)](https://npmjs.com/package/astro-portabletext)
[![npm downloads](https://img.shields.io/npm/dm/astro-portabletext.svg?style=flat-square)](https://npmjs.com/package/astro-portabletext)
![license](https://img.shields.io/npm/l/astro-portabletext?style=flat-square)

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:



Open in StackBlitz


Open in CodeSandbox

## 📖 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 Logo](https://avatars.githubusercontent.com/u/17177659?s=24) 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).