🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@portabletext/schema

Package Overview
Dependencies
Maintainers
10
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@portabletext/schema

Portable Text Schema

latest
Source
npmnpm
Version
2.1.1
Version published
Weekly downloads
358K
-11.61%
Maintainers
10
Weekly downloads
 
Created
Source

@portabletext/schema

A TypeScript library for defining and compiling Portable Text schemas with full type safety and editor support.

Installation

npm install @portabletext/schema

Usage

Define a Schema

import {defineSchema} from '@portabletext/schema'

const schemaDefinition = defineSchema({
  styles: [{name: 'normal'}, {name: 'h1'}, {name: 'h2'}, {name: 'blockquote'}],
  decorators: [{name: 'strong'}, {name: 'em'}],
  annotations: [{name: 'link'}],
  lists: [{name: 'bullet'}, {name: 'numbered'}],
})

Compile Schema

import {compileSchema} from '@portabletext/schema'

const schema = compileSchema(schemaDefinition)

Keywords

portabletext

FAQs

Package last updated on 16 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts