
Product
Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.
@limitless-angular/sanity
Advanced tools
A powerful Angular library for Sanity.io integration, featuring Portable Text rendering and optimized image loading.
Limitless Angular is a powerful collection of Angular libraries focused on Sanity.io integration, designed to enhance your development experience with features like Portable Text rendering, image optimization, real-time previews, and visual editing.
npm install --save @limitless-angular/sanity
| Angular version | Package version |
|---|---|
| ≥18.0.0 | 18.x |
For image optimization features:
import { ApplicationConfig } from '@angular/core';
import { provideSanity } from '@limitless-angular/sanity';
export const appConfig: ApplicationConfig = {
providers: [
provideSanity({
projectId: 'your-project-id',
dataset: 'your-dataset',
}),
],
};
For preview and visual editing features, use the client factory approach:
import { provideSanity, withLivePreview } from '@limitless-angular/sanity';
import { createClient } from '@sanity/client';
const client = createClient({
projectId: 'your-project-id',
dataset: 'your-dataset',
apiVersion: 'YYYY-MM-DD',
useCdn: true,
});
const getClientFactory = (preview?: { token: string }) =>
preview?.token
? client.withConfig({
token: preview.token,
useCdn: false,
ignoreBrowserTokenWarning: true,
perspective: 'previewDrafts',
stega: {
enabled: true,
studioUrl: 'your-studio-url',
},
})
: client;
export const appConfig: ApplicationConfig = {
providers: [provideSanity(getClientFactory, withLivePreview())],
};
Render Portable Text with Angular.
@Component({
standalone: true,
imports: [PortableTextComponent],
template: `<div portable-text [value]="content" [components]="components"></div>`,
})
export class ContentComponent {
content = [
/* your portable text content */
];
components: PortableTextComponents = {
// Custom components configuration
};
}
Powerful features for working with Sanity images in Angular applications:
@Component({
standalone: true,
imports: [SanityImage],
template: `
<img
[sanityImage]="imageRef"
width="800"
height="600"
[alt]="imageRef.alt"
/>
`,
})
The Preview Kit provides real-time preview capabilities for Sanity content in Angular applications, enabling live updates of content as it's being edited in the Sanity Studio:
import { LiveQueryProviderComponent } from '@limitless-angular/sanity/preview-kit';
@Component({
standalone: true,
imports: [LiveQueryProviderComponent],
template: `
@if (draftMode()) {
<live-query-provider [token]="token">
<router-outlet />
</live-query-provider>
} @else {
<router-outlet />
}
`,
})
export class AppComponent {
draftMode = signal(false);
token = signal('your-preview-token');
}
The Visual Editing feature allows editors to click elements in your preview to navigate directly to the corresponding document and field in Sanity Studio.
@Component({
standalone: true,
imports: [VisualEditingComponent],
template: `
<main>
<router-outlet />
@if (draftMode()) {
<visual-editing />
}
</main>
`,
})
export class AppComponent {}
📚 Visual Editing Documentation
We welcome contributions! Check our Contributing Guide for details.
Adapted from @portabletext/react which provided the vast majority of node rendering logic.
This project is licensed under the MIT License. See our LICENSE file for details.
FAQs
A powerful Angular library for Sanity.io integration, featuring Portable Text rendering and optimized image loading.
The npm package @limitless-angular/sanity receives a total of 1,075 weekly downloads. As such, @limitless-angular/sanity popularity was classified as popular.
We found that @limitless-angular/sanity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.