Part 4 of 7. All parts: part 1. Previous: part 3, installing Content Kit atoms. Next: part 5, AI skills and an agent run.
This part moves our own atom into the layout the Content Kit uses and adds a second atom. That layout is the Content Kit's convention and the beta docs do not describe it, so check it against later releases. The result is the part-4-folders tag in the companion repository.
To see the end result of this part, clone the companion repository and check out its tag:
| 1 | git clone https://github.com/rhockUxbee/sitecoreai-content-sdk-nextjs-app-router-atoms-beta.git |
| 2 | cd sitecoreai-content-sdk-nextjs-app-router-atoms-beta |
| 3 | git checkout part-4-folders |
Preliminary post. Written with AI assistance and run locally against the starter. Tested with Content SDK beta build 20261105114751, November 2026. Uxbee has requested Early Access to atoms in SitecoreAI but does not have it yet, so for the moment the Design Studio steps come from Sitecore's documentation and are untested. These posts will be updated once we have access. More in part 1.
Why follow the Content Kit's layout
In part 2, src/atoms/index.tsx holds one atom. That is the documented route: Sitecore's docs say the CLI reads the named catalog export from src/atoms/index.ts or index.tsx, and they show no folder layout. With a dozen atoms, one file gets hard to read and review.
After part 3 the project already has a layout, because the Content Kit installed one. Each atom gets a folder under src/components/atoms with a schema file and a renderer, and src/atoms holds the catalog, the registry and the entry file. Our own atoms can follow it, so the project keeps one convention. Christian Hahn's atom-create skill, which part 5 looks at, calls it the Content Kit convention too.
I first thought about folders by category, such as interactive, forms and typography. The Content Kit does not do that. Its folders are flat, one per atom, and some descriptions carry a category: the Button starts with "Category: Media." and the Container with "Category: Layout." The others use "Typography:" or "Media:", and the Heading has none, so it is a habit and not a rule. For our own atoms I use "Category: X.", the same form as the Button and the Container.
The layout
| 1 | src/ |
| 2 | atoms/ |
| 3 | index.ts exports catalog and registry (from the Content Kit) |
| 4 | catalog.ts lists every atom |
| 5 | registry.tsx maps every atom to its renderer |
| 6 | components/ |
| 7 | atoms/ |
| 8 | index.ts exports the schemas |
| 9 | button/ the six Content Kit atoms, from part 3: |
| 10 | heading/ button, heading, paragraph, image, number |
| 11 | paragraph/ and container, each with name.schema.ts |
| 12 | image/ and name.tsx |
| 13 | number/ |
| 14 | container/ |
| 15 | badge/ our own atoms |
| 16 | badge.schema.ts |
| 17 | badge.tsx |
| 18 | card/ |
| 19 | card.schema.ts |
| 20 | card.tsx |
| 21 | lib/ |
| 22 | atoms-utils.ts the cn helper the atoms use |
The tree leaves out the Container's extra file container.props.ts and the shadcn files from part 3: components.json at the root, and shadcn's own Button and utils under src/components/components and src/components/lib.
Move the Badge
The schema file holds what used to sit inline in the catalog:
| 1 | import { textFieldSchema } from "@sitecore-content-sdk/nextjs/atoms"; |
| 2 | import { z } from "zod"; |
| 3 | |
| 4 | export const badgeCatalogDefinition = { |
| 5 | props: z.object({ |
| 6 | text: textFieldSchema().describe("Single-Line Text field shown in the badge."), |
| 7 | tone: z |
| 8 | .enum(["neutral", "info", "success", "warning"]) |
| 9 | .default("neutral") |
| 10 | .describe("Colour role."), |
| 11 | className: z.string().optional().describe("Optional extra classes."), |
| 12 | }), |
| 13 | description: |
| 14 | 'Category: Typography. A small label for a status or category, such as "New" or "Beta". Use the tone to signal meaning.', |
| 15 | slots: [], |
| 16 | }; |
| 17 | |
| 18 | export type BadgeProps = z.infer<typeof badgeCatalogDefinition.props>; |
The renderer takes the props directly, as the Content Kit's Button does, and renders nothing when the field is empty:
| 1 | import { cn } from "lib/atoms-utils"; |
| 2 | |
| 3 | import type { BadgeProps } from "./badge.schema"; |
| 4 | |
| 5 | const toneClasses = { |
| 6 | neutral: "bg-neutral-100 text-neutral-800", |
| 7 | info: "bg-blue-100 text-blue-800", |
| 8 | success: "bg-green-100 text-green-800", |
| 9 | warning: "bg-amber-100 text-amber-900", |
| 10 | } as const; |
| 11 | |
| 12 | function Badge({ text, tone = "neutral", className }: BadgeProps) { |
| 13 | const value = text?.value; |
| 14 | if (value === undefined || value === "") { |
| 15 | return null; |
| 16 | } |
| 17 | |
| 18 | return ( |
| 19 | <span |
| 20 | data-slot="badge" |
| 21 | className={cn( |
| 22 | "inline-block rounded-full px-3 py-1 text-sm font-medium", |
| 23 | toneClasses[tone], |
| 24 | className, |
| 25 | )} |
| 26 | > |
| 27 | {String(value)} |
| 28 | </span> |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | export { Badge }; |
Compared with part 2, I made three changes while moving it: the description now starts with its category, the slots are an explicit empty list, and the props carry describe() texts.
This counts as a schema change. Validation reports IV-010 for the Badge, and atoms:update accepts it. I tested which of the three changes caused it, by removing them one at a time:
- Removing the category from the description changes the hash.
- Removing
slots: []changes the hash. - Removing the
describe()calls does not change the hash. Sodescribe()texts are invisible to the lock file. Christian Hahn's skill says the same, and that you should bump the atom's version by hand when only those change.
Add a Card with a slot
The second atom has a slot, so other atoms can go inside it, and it names the atoms that are meant to go there:
| 1 | import { textFieldSchema } from "@sitecore-content-sdk/nextjs/atoms"; |
| 2 | import { z } from "zod"; |
| 3 | |
| 4 | export const cardCatalogDefinition = { |
| 5 | props: z.object({ |
| 6 | title: textFieldSchema() |
| 7 | .optional() |
| 8 | .describe("Optional Single-Line Text field shown as the card title."), |
| 9 | className: z.string().optional().describe("Optional extra classes."), |
| 10 | }), |
| 11 | description: |
| 12 | "Category: Layout. A bordered card with an optional title. Place other atoms, such as a Badge, in its default slot.", |
| 13 | slots: ["default"], |
| 14 | allowedChildren: ["Badge"], |
| 15 | }; |
| 16 | |
| 17 | export type CardProps = z.infer<typeof cardCatalogDefinition.props>; |
| 1 | import type { ReactNode } from "react"; |
| 2 | |
| 3 | import { cn } from "lib/atoms-utils"; |
| 4 | |
| 5 | import type { CardProps } from "./card.schema"; |
| 6 | |
| 7 | function Card({ title, className, children }: CardProps & { children?: ReactNode }) { |
| 8 | const heading = title?.value; |
| 9 | |
| 10 | return ( |
| 11 | <div data-slot="card" className={cn("rounded-lg border p-4", className)}> |
| 12 | {heading ? <h3 className="mb-2 font-semibold">{String(heading)}</h3> : null} |
| 13 | {children} |
| 14 | </div> |
| 15 | ); |
| 16 | } |
| 17 | |
| 18 | export { Card }; |
Wire them into the catalog and the registry
The two files in src/atoms now just list the atoms:
| 1 | import { defineAtomsCatalog } from "@sitecore-content-sdk/nextjs/atoms"; |
| 2 | |
| 3 | import { badgeCatalogDefinition } from "components/atoms/badge/badge.schema"; |
| 4 | import { buttonCatalogDefinition } from "components/atoms/button/button.schema"; |
| 5 | import { cardCatalogDefinition } from "components/atoms/card/card.schema"; |
| 6 | import { containerCatalogDefinition } from "components/atoms/container/container.schema"; |
| 7 | import { headingCatalogDefinition } from "components/atoms/heading/heading.schema"; |
| 8 | import { imageCatalogDefinition } from "components/atoms/image/image.schema"; |
| 9 | import { numberCatalogDefinition } from "components/atoms/number/number.schema"; |
| 10 | import { paragraphCatalogDefinition } from "components/atoms/paragraph/paragraph.schema"; |
| 11 | |
| 12 | export const catalog = defineAtomsCatalog({ |
| 13 | version: "1.0.0", |
| 14 | stylingSolution: "tailwind", |
| 15 | components: { |
| 16 | Button: buttonCatalogDefinition, |
| 17 | Heading: headingCatalogDefinition, |
| 18 | Paragraph: paragraphCatalogDefinition, |
| 19 | Image: imageCatalogDefinition, |
| 20 | Number: numberCatalogDefinition, |
| 21 | Container: containerCatalogDefinition, |
| 22 | // our own atoms |
| 23 | Badge: badgeCatalogDefinition, |
| 24 | Card: cardCatalogDefinition, |
| 25 | }, |
| 26 | actions: {}, |
| 27 | }); |
| 1 | "use client"; |
| 2 | |
| 3 | import { defineAtomsRegistry } from "@sitecore-content-sdk/nextjs/atoms"; |
| 4 | |
| 5 | import { Badge } from "components/atoms/badge/badge"; |
| 6 | import { Button } from "components/atoms/button/button"; |
| 7 | import { Card } from "components/atoms/card/card"; |
| 8 | import { Container } from "components/atoms/container/container"; |
| 9 | import { Heading } from "components/atoms/heading/heading"; |
| 10 | import { Image } from "components/atoms/image/image"; |
| 11 | import { NumericInput } from "components/atoms/number/number"; |
| 12 | import { Paragraph } from "components/atoms/paragraph/paragraph"; |
| 13 | |
| 14 | import { catalog } from "./catalog"; |
| 15 | |
| 16 | export const registry = defineAtomsRegistry(catalog, { |
| 17 | components: { |
| 18 | Button: ({ props }) => <Button {...props} />, |
| 19 | Heading: ({ props }) => <Heading {...props} />, |
| 20 | Paragraph: ({ props }) => <Paragraph {...props} />, |
| 21 | Image: ({ props }) => <Image {...props} />, |
| 22 | Number: ({ props }) => <NumericInput {...props} />, |
| 23 | Container: ({ props, children }) => <Container {...props}>{children}</Container>, |
| 24 | // our own atoms |
| 25 | Badge: ({ props }) => <Badge {...props} />, |
| 26 | Card: ({ props, children }) => <Card {...props}>{children}</Card>, |
| 27 | }, |
| 28 | actions: {}, |
| 29 | }); |
The container atom gets its children from the registry and hands them to the renderer. That is the one difference from a leaf atom.
What I checked
Right after the move, before updating the lock file:
| 1 | [IE-008] Lock file validation failed: |
| 2 | - [IV-010] Atom "Badge" schema has changed. |
| 3 | - [MV-014] Atom "Card" is new and not in the lock file. Run `sitecore-tools project atoms update` to add it. |
IV-010 is the Badge, for the reasons above, and MV-014 is the new Card. After atoms:update the lock file held all eight atoms, and validation passed. Then:
npx tsc --noEmitshowed no errors, and a wrong prop name in the Badge's renderer failed to compile.npm run buildran to the end, and the component map still only held the starter's own component, because the exclusions from part 3 coversrc/components/atoms.- The metadata showed the Card with
slots: ["default"]andallowedChildren: ["Badge"], and the Badge with an emptyslotslist. The Container, the only other atom with a slot, was unchanged.
Caveats
- This layout is the Content Kit's. The beta docs do not describe it, so check it against later releases.
- The atom folders sit under
src/components, which the component-map generator scans. Without the exclusions from part 3 they would end up in the component map. - The catalog key and the registry key must match, and the docs say so.
- I checked the Card's slot and
allowedChildrenonly in the metadata and have not seen them in Design Studio. Christian Hahn's skill saysallowedChildrenis a hint for Design Studio and not enforced at runtime. I have not tested that. - A layout with category folders under
src/atomsalso worked in my test, with the same hash, but it would put two conventions in one project, so I dropped it.
Checklist
- One folder per atom under
src/components/atoms, withname.schema.tsandname.tsx. - Start every description with
Category:and the category. - List the atom in
catalog.tsandregistry.tsx, with the same key in both. - Run
atoms:updateafter every schema change, and commit the lock file.





