Listing documents of a specific schema type in a pane while also listing other document type list items in Slack.
Yes, absolutely! You can combine a documentTypeListItem() (which shows all documents of a type) with other filtered list items in the same pane using the Structure Builder API.
Here's a practical example showing all 'person' documents alongside a filtered 'directors' list:
// ./structure/index.ts
import type {StructureResolver} from 'sanity/structure'
export const structure: StructureResolver = (S) =>
S.list()
.title('People')
.items([
// All person documents
S.documentTypeListItem('person').title('All People'),
S.divider(),
// Filtered list showing only directors
S.listItem()
.title('Directors')
.child(
S.documentList()
.apiVersion('2024-06-01')
.title('Directors')
.schemaType('person')
.filter('_type == "person" && role == "director"')
),
// You could add more filtered lists
S.listItem()
.title('Producers')
.child(
S.documentList()
.apiVersion('2024-06-01')
.title('Producers')
.schemaType('person')
.filter('_type == "person" && role == "producer"')
),
])The key difference is:
documentTypeListItem()- A convenience method that automatically shows all documents of that typelistItem()+documentList()- Gives you full control to add filters and create specialized views
You can mix and match these freely in the same items() array. The Structure Builder cheat sheet has great examples of both approaches, and you can read more about dynamically grouping list items with GROQ filters for more complex scenarios.
This pattern is really useful for creating role-based views, status filters, or any other way you want to organize your content while still maintaining access to the complete unfiltered list!
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.