Estimated reading time
Content estimated reading time component in TypeScript.
Go to Estimated reading timeBrowse ready-made Sanity.io schemas to structure your content quickly. Find useful code snippets for workflows, input components, migration scripts, and studio configurations.
Content estimated reading time component in TypeScript.
Go to Estimated reading timethis blog for beginner how to make blog in sanity with next js
Go to Next.JS blog use sanityGROQ doesn't yet include a function to match the end of a string, but we can simulate it by splitting our string on our term.
Go to Matching the end of a string in GROQSimplify your Studio experience by hiding deprecated fields when you create new documents.
Go to Hide a deprecated field in new documents🚫 MyFile / ✅ MyFile.pdf
Go to Add extensions to asset original filenamesThis snippet is useful if you want a desk structure that allows columns with a parent page and children pages underneath it. As deep as you would like.
Go to Unlimited nestingLearn how to build a custom image gallery preview component that can be added to Portable Text.
Go to Custom Image Gallery Preview Component - Portable TextIf you're working on integrating portable text with custom markDefs using groqd, the following code snippet could be very useful. It might save you a considerable amount of research time.
Go to groqd implementation with portable text custom marksIf you install plugins or other packages with conflicting (peer) dependencies, you can use this useful workaround to unblock yourself.
Go to What to do when Studio crashes due to conflicts in dependency versions?Variant Generator for Products with Options
Go to Variant Generator Custom Input Component for Products with OptionsOpen editor and preview pane in split view all the time
Go to Open editor and preview pane in split view all the timeInsert related components next to a native one
Go to Helper function to add custom components above or below a native one.A code snippet to create a custom '+ Add item' button to add items to the top of an array.
Go to Add items to top of array with custom '+ Add item' buttonWanna use Sanity to build a PageBuilder? Show previews of your blocks/sections!
Go to Custom PageBuilder Input Component - Preview Blocks & SectionsOn the fly form generation with Sanity & Formspark
Go to Sanity & Formspark Form GeneratorIf you're looking to mockup portable text in Storybook without a Sanity backend, this is the schema you're looking for
Go to Portable Text Mock ContentCode examples using document.newDocumentOptions to hide the Create new document button at the structure level and/or disable it in the global create menu.
Go to Disable new document creation button at structure and global level with document.newDocumentOptionsA dynamic group filled with fields that don't have any defined group.
Go to Create a dynamic 'Unmapped fields' group in your document definition