@portabletext/solid
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

@portabletext/solid

npm versionnpm bundle size

Render Portable Text with Solid JS.

Table of contents

Installation

npm install --save @portabletext/solid

Basic usage

import { PortableText, type PortableTextComponents } from '@portabletext/solid'
import type { PortableTextBlock } from '@portabletext/types'
import type { Component } from 'solid-js'

const blocks: PortableTextBlock[] = [
  /* array of portable text blocks */
]

const components: PortableTextComponents = {
  /* optional object of custom components to use */
}

const App: Component = () => {
  return <PortableText value={blocks} components={components} />
}

Credits

This repository is based on solid-portabletext, shoutout to @nonphoto for the original work 💖

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @portabletext/solid

Weekly Downloads

14

Version

1.0.6

License

MIT

Unpacked Size

168 kB

Total Files

14

Last publish

Collaborators

  • stipsan
  • snorreeb
  • sanity-io
  • kmelve
  • rexxars
  • skogsmaskin
  • mariuslundgard
  • bjoerge
  • rbotten