A powerful Angular library for Sanity.io integration, featuring Portable Text rendering and optimized image loading.
npm install @limitless-angular/sanity


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.
- π Portable Text Live Demo
- π» Example Project
- π¦ NPM Package
- β¨ Portable Text: Complete implementation for rendering Sanity's Portable Text
- πΌοΈ Image Optimization: Built-in image loader and directives for Sanity images
- π Real-time Preview: Live content updates with Preview Kit
- βοΈ Visual Editing: Seamless content management integration
- π― Angular-First: Built specifically for Angular 18+
``bash`
npm install --save @limitless-angular/sanity
| Angular version | Package version |
| --------------- | --------------- |
| 18.x | 18.x |
| β₯18.0.0 | 19.x |
For image optimization features:
`typescript
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:
`typescript
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.
`typescript
@Component({
standalone: true,
imports: [PortableTextComponent],
template:
,
})
export class ContentComponent {
content = [
/ your portable text content /
];
components: PortableTextComponents = {
// Custom components configuration
};
}
`π Portable Text Documentation
$3
Powerful features for working with Sanity images in Angular applications:
`typescript
@Component({
standalone: true,
imports: [SanityImage],
template: ,
})
`π Image Loader Documentation
$3
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:
`typescript
import { LiveQueryProviderComponent } from '@limitless-angular/sanity/preview-kit';@Component({
standalone: true,
imports: [LiveQueryProviderComponent],
template:
,
})
export class AppComponent {
draftMode = signal(false);
token = signal('your-preview-token');
}
`π Preview Kit Documentation
$3
The Visual Editing feature allows editors to click elements in
your preview to navigate directly to the corresponding
document and field in Sanity Studio.
`typescript
@Component({
standalone: true,
imports: [VisualEditingComponent],
template: ,
})
export class AppComponent {}
``π Visual Editing Documentation
- π― Performance optimizations
- π Enhanced documentation and examples
- β
Comprehensive test coverage
- π Lazy loading for Portable Text components
We welcome contributions! Check our Contributing Guide for details.
- π Report Issues
- π¬ Discussions
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.