Henrique Doro
Sanity user & community member turned employee 😊 (Applications Engineer)
Speed up your Sanity.io development with snippets tailored for building schemas, queries and desk structures ✨
A set of useful snippets to speed up your Sanity.io development. I've been using some of these snippets for 2.5 years now, and they drastically increase my capacity to deliver fast and precisely, hope you enjoy 😊
Every snippets starts with either sanity(...)
or groq(...)
, so you know they won't collide with your other snippets. They are enabled for Javascript & Typescript files, reach out if you need to enable them for other extensions.
sanitySchema
): Create a simple schema for the CMS (document, object or image)sanityFld
): Add a field to a sanity object / documentsanityDesc
): Add a custom description to a field, document or objectsanityOptional
): Add a cue that a field is optionalsanityOptionalEncouraged
): Add a cue that a field is optional, but encourage writing itsanityTip
): Add a tip as a field's descriptionsanityFieldset
): Add fieldsets to a sanity object / documentsanityCollapse
): Make a given object field collapsible to help editors scroll less through the documentsanityRequired
): Make a given field requiredsanityArrValidation
): Validate an array field based on its lengthsanityArrFld
): Create a basic array field in SanitysanityObjFld
): Create a basic object field in SanitysanityRefFld
): Create a basic reference field in SanitysanityPreviewSelect
): Add a basic preview with selection object in SanitysanityPreviewSelectPrepare
): Add a preview with selection object and prepare function in SanitysanitySelect
): Add a basic selection object for preview in SanitysanityPrepare
): Add a prepare function for preview in SanitygroqDraftConstraint
): Constraint for groq queries to prevent or limit to drafted documentssanityViewComponent
): Add a view to a document with a React componentsanityDocList
): Adds a listItem in your desk structure for custom document list. Perfect for filtering by document values or adding docs from multiple typesFeel free to contribute your snippets!
Your feedback is very much appreciated as long as it's respectful and inclusive :)
Sanity user & community member turned employee 😊 (Applications Engineer)
Render Portable Text block content with Svelte components.
Go to PortableText to SvelteAllows uploading, referencing and deleting video and audio files to S3 directly from your Sanity studio.
Go to AWS S3 media browserEditor friendly slug fields for your Sanity.io studio
Go to Better slug inputShow your editors how their page will look on Google and major social platforms in your documents' view.
Go to Sanity social and SEO document preview