Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 2.19 KB

README.md

File metadata and controls

34 lines (22 loc) · 2.19 KB

astro-portabletext Examples

This directory provides concise code examples demonstrating specific techniques and features of the astro-portabletext library. These examples are designed to help you learn and adapt the code snippets for your own Astro projects.

💡 Looking for documentation? Refer to the package documentation.

Note: These are not full applications.

Available examples

Customizing Components

  • Block.astro — Shows how to extend and override the default rendering of specific block styles (node.style).
  • List.astro / ListItem.astro — Covers extending and overriding the default rendering of specific list items (node.listItem).
  • Mark.astro — Explains how to extend and override the rendering of specific mark types (node.markType).
  • Text.astrov0.11.0+ Illustrates handling the output of @text nodes in Portable Text.
  • Type.astro — Demonstrates handling custom Portable Text types (node._type) to render different components for each type, including a fallback for unknown types.

PortableText component

Advanced techniques

Contributing

Have suggestions for new examples or improvements? Feel free to open a pull request or an issue in the main repository. Contributions are always welcome!