1. How swift-docc-render consumes this
Important caveat found during research: tile is declared as a case of
RenderSectionKind in swift-docc
(Sources/SwiftDocC/Model/Rendering/RenderSection.swift:17, case hero, intro, tasks,
assessments, volume, contentAndMedia, contentAndMediaGroup, callToAction, tile, articleBody,
resources), but there is no RenderSection-conforming struct anywhere in
swift-docc whose kind is "tile", and no "kind": "tile" literal appears
anywhere in the wire format. Searching AnyRenderSection.swift and
CodableRenderSection.swift (the two places that switch over every RenderSectionKind
case to decode a section) turns up no reference to .tile at all. The enum case appears to be
reserved/vestigial.
What DocC actually emits under the name "tile" is RenderTile
(Sources/SwiftDocC/Model/Rendering/Tutorials Overview/Resources/RenderTile.swift) — a plain
Codable struct with no kind field of its own. It is never a top-level
section; it only appears as an element of the tiles array inside
ResourcesRenderSection, whose own discriminator is "kind": "resources", not
"tile". This page therefore documents RenderTile/tile as an embedded
object type, consistent with how the JSON schema (step 2 below) models it — as an inline, untagged object
under ResourcesRenderSection.tiles, not as its own discriminated section.
Tracing how swift-docc-render actually renders this data, starting from the top of a tutorial overview
page: LearningPath.vue receives the render node's top-level sections array and
keeps a small SectionKind lookup ({ resources: 'resources', volume: 'volume' }).
Anything whose section.kind is "resources" is routed to
Resources.vue, and only content and tiles are forwarded as props:
const SectionKind = { resources: 'resources', volume: 'volume' };
...
componentFor: ({ kind }) => ({
[SectionKind.resources]: Resources,
[SectionKind.volume]: Volume,
}[kind]),
propsFor: ({ chapters, content, image, kind, name, tiles }) => ({
[SectionKind.resources]: { content, tiles },
[SectionKind.volume]: { chapters, content, image, name },
}[kind]),
See LearningPath.vue#L38-L105 for the dispatch table and prop-forwarding.
Resources.vue's template is a two-line wrapper: a VolumeName heading (labelled
"Resources") followed by a TileGroup bound directly to the tiles prop:
<section class="resources" id="resources" tabindex="-1">
<VolumeName :name="$t('sections.resources')" :content="content" />
<TileGroup :tiles="tiles" />
</section>
See
Resources.vue#L11-L59.
TileGroup is a local alias for ResourcesTileGroup.vue.
ResourcesTileGroup.vue loops the array with v-for="tile in tiles", forwarding
exactly the four fields the wire format defines (action, content,
identifier, title) as props to one Tile component instance per
array element — this is the actual per-item dispatch site for an individual tile object:
<div class="tile-group" :class="countClass">
<Tile v-for="tile in tiles" v-bind="propsFor(tile)" :key="tile.title" />
</div>
...
propsFor: ({ action, content, identifier, title }) => ({ action, content, identifier, title }),
See
ResourcesTileGroup.vue#L11-L46.
Tile here is a local alias for ResourcesTile.vue — the component that actually
renders one tile's markup.
ResourcesTile.vue renders the tile's icon (chosen from identifier), title,
body content (delegated to the generic ContentNode block-content renderer), and an optional
call-to-action link:
<div class="tile">
<div v-if="identifier" class="icon">
<component :is="iconComponent" />
</div>
<div class="title">{{ title }}</div>
<ContentNode :content="content" />
<DestinationDataProvider v-if="action" :destination="action" v-slot="{ url, title }">
<Reference class="link" :url="url">
{{ title }}
<InlineChevronRightIcon class="link-icon icon-inline" />
</Reference>
</DestinationDataProvider>
</div>
See
ResourcesTile.vue#L11-L96.
identifier selects the icon component from a fixed map
(documentation→DocumentIcon, downloads→DownloadIcon,
forums→ForumIcon, sampleCode→CurlyBracketsIcon,
videos→PlayIcon; the sixth wire value, featured, has no icon and
falls through to undefined, so no icon renders). action, when present, is resolved
through DestinationDataProvider/Reference to a real link with a trailing chevron
icon.
Note: there is a separate, unrelated .tile CSS class in
Volume.vue (a "chapter" card in the same tutorials-overview page) — same class name, different
component and different wire kind (volume.chapters[], not ResourcesRenderSection.tiles[]).
It is not connected to this page's tile and is out of scope here.
See also: Localization fallback — how $t()/locale-key lookup works across every kind that uses it.
2. Example JSON and rendered mockup
No fixture in DocCArchive's test archives (ExampleDocs.doccarchive,
SampleLibrary.doccarchive — both are documentation-only archives with no tutorial/resources
content) or in swift-docc's JSON test corpus contains a raw "tiles" or
"kind": "resources" literal. swift-docc's own coverage of this data
(Tests/SwiftDocCTests/Model/SemaToRenderNodeTests.swift, around line 661) asserts against
decoded Swift values, not an embedded JSON literal, built from a real authoring-side fixture,
Tests/SwiftDocCTests/Test Bundles/LegacyBundle_DoNotUseInNewTests.docc/TestOverview.tutorial,
whose @Resources block is:
@Resources {
Find the tools and a comprehensive set of resources for creating AR experiences on iOS.
@Documentation(destination: "https://www.example.com/documentation/technology") {
Browse and search detailed API documentation.
- <doc://org.swift.docc.example/TestTutorial>
- <doc://org.swift.docc.example/TestTutorial2>
}
@SampleCode(destination: "https://www.example.com/documentation/technology") {
Browse and search detailed sample code.
- <doc://org.swift.docc.example/TestTutorial>
- <doc://org.swift.docc.example/TestTutorial2>
}
@Downloads(destination: "https://www.example.com/download") {
Download Xcode 10, which includes the latest tools and SDKs.
}
@Videos(destination: "https://www.example.com/videos") {
See AR presentation from WWDC and other events.
}
@Forums(destination: "https://www.example.com/forums") {
Discuss AR with Apple engineers and other developers.
}
}
This is the "what an author writes to produce this" side: each nested directive
(@Documentation, @SampleCode, @Downloads, @Videos,
@Forums) becomes exactly one RenderTile, with the directive name mapping to the
tile's identifier and the directive's title-cased name (or an explicit title) becoming
title. The JSON below is hand-written to match the schema in the data sheet, using the same
titles/content that SemaToRenderNodeTests.swift asserts this exact fixture decodes to
(tiles[0].title == "Documentation", tiles[2].title == "Xcode and SDKs", etc.), but
the raw JSON text itself does not exist verbatim in either repository, so it is marked as synthesized.
{
"kind": "resources",
"content": [
{ "type": "paragraph", "inlineContent": [
{ "type": "text", "text": "Find the tools and a comprehensive set of resources for creating AR experiences on iOS." }
] }
],
"tiles": [
{
"identifier": "documentation",
"title": "Documentation",
"content": [
{ "type": "paragraph", "inlineContent": [
{ "type": "text", "text": "Browse and search detailed API documentation." }
] },
{ "type": "unorderedList", "items": [
{ "content": [ { "type": "paragraph", "inlineContent": [
{ "type": "reference", "identifier": "doc://org.swift.docc.example/tutorials/Test-Bundle/TestTutorial", "isActive": true }
] } ] },
{ "content": [ { "type": "paragraph", "inlineContent": [
{ "type": "reference", "identifier": "doc://org.swift.docc.example/tutorials/Test-Bundle/TestTutorial2", "isActive": true }
] } ] }
] }
]
},
{
"identifier": "sampleCode",
"title": "Sample Code",
"content": [
{ "type": "paragraph", "inlineContent": [
{ "type": "text", "text": "Browse and search detailed sample code." }
] },
{ "type": "unorderedList", "items": [
{ "content": [ { "type": "paragraph", "inlineContent": [
{ "type": "reference", "identifier": "doc://org.swift.docc.example/tutorials/Test-Bundle/TestTutorial", "isActive": true }
] } ] },
{ "content": [ { "type": "paragraph", "inlineContent": [
{ "type": "reference", "identifier": "doc://org.swift.docc.example/tutorials/Test-Bundle/TestTutorial2", "isActive": true }
] } ] }
] }
]
},
{
"identifier": "downloads",
"title": "Xcode and SDKs",
"content": [
{ "type": "paragraph", "inlineContent": [
{ "type": "text", "text": "Download Xcode 10, which includes the latest tools and SDKs." }
] }
],
"action": { "type": "reference", "identifier": "https://www.example.com/download", "isActive": true }
},
{
"identifier": "videos",
"title": "Videos",
"content": [
{ "type": "paragraph", "inlineContent": [
{ "type": "text", "text": "See AR presentation from WWDC and other events." }
] }
],
"action": { "type": "reference", "identifier": "https://www.example.com/videos", "isActive": true }
},
{
"identifier": "forums",
"title": "Forums",
"content": [
{ "type": "paragraph", "inlineContent": [
{ "type": "text", "text": "Discuss AR with Apple engineers and other developers." }
] }
],
"action": { "type": "reference", "identifier": "https://www.example.com/forums", "isActive": true }
}
]
}
Rendered mockup approximating the resulting tile grid (5 tiles → a 6-column/2-row layout per .tile-group.count-5):
Documentation
Browse and search detailed API documentation.
- Test Tutorial
- Test Tutorial 2
Sample Code
Browse and search detailed sample code.
- Test Tutorial
- Test Tutorial 2
Xcode and SDKs
Download Xcode 10, which includes the latest tools and SDKs.
→ View downloads
Videos
See AR presentation from WWDC and other events.
→ Watch videos
Forums
Discuss AR with Apple engineers and other developers.
→ View forums
3. Data sheet
There is no standalone TileRenderSection schema object. The relevant schema is
ResourcesRenderSection in Sources/DocCArchive/Vendored/RenderNode.spec.json lines
360-406, whose tiles field is an array of an inline, unnamed object schema (no
$ref) with no kind/discriminator property of its own. The corresponding generated
Swift type in Sources/DocCArchive/generated/Types.swift lines 3466-3546 is
Components.Schemas.ResourcesRenderSection, and the per-tile type — because the schema gave it
no name — is synthesized by swift-openapi-generator as the nested type
Components.Schemas.ResourcesRenderSection.TilesPayloadPayload.
ResourcesRenderSection (the enclosing section)
| Field | Type | Required | Enum / default | Note |
|---|---|---|---|---|
kind | string | yes | "resources" (only value) | Section discriminator; generated as KindPayload single-case enum. Not "tile". |
tiles | array of inline object | yes | — | The array documented below; generated as TilesPayload = [TilesPayloadPayload]. |
ResourcesRenderSection.tiles[] (the "tile" object — TilesPayloadPayload)
| Field | Type | Required | Enum / default | Note |
|---|---|---|---|---|
identifier | string | yes | "featured" | "documentation" | "sampleCode" | "downloads" | "videos" | "forums" | Generated as IdentifierPayload; selects the icon component in ResourcesTile.vue (no icon for featured). |
title | string | yes | — | Rendered verbatim as the tile heading. |
content | array of RenderBlockContent | yes | — | Tile body, delegated to ContentNode. |
action | RenderInlineContent | no | — | Call-to-action link/reference; when present, rendered as a chevron-suffixed link via DestinationDataProvider. |
media | string (reference id), nullable | no | — | Declared in the JSON schema ("format": "reference", "nullable": true); generated as an optional Swift.String?. Not read anywhere in ResourcesTile.vue/ResourcesTileGroup.vue/Resources.vue — present in the wire format but currently unused by the render UI. |
Source: Sources/DocCArchive/Vendored/RenderNode.spec.json lines 360-406
(ResourcesRenderSection, including the inline tiles item schema); generated types
at Sources/DocCArchive/generated/Types.swift lines 3466-3546. For comparison, the
authoring-side Swift model in swift-docc is RenderTile
(Sources/SwiftDocC/Model/Rendering/Tutorials Overview/Resources/RenderTile.swift), which has
the identical four fields (identifier, title, content, action,
media) plus its own nested Identifier enum with the same six raw values.
4. HTML/CSS mapping in DocC-Render output
section#resources.resources— root of the whole resources block, rendered byResources.vue; carries a scroll-margintabindex="-1"for the on-page navigation anchor..tile-group(on the wrapping<div>fromResourcesTileGroup.vue) — a CSS grid whose column/row layout is chosen entirely by acount-Nmodifier class (count-1throughcount-6, one class per possible tile count 1-6), each with its owngrid-template-columns/grid-template-rows; e.g.count-5uses a 6-column grid where the first two tiles span 3 columns and the rest span 2.$tile-margincomes from the SCSS variable$tutorials-overview-tile-margin-single-side(src/styles/core/_vars.scss:29, currently2px)..tile(on each tile's root<div>, fromResourcesTile.vue) — backgroundvar(--color-tutorials-overview-fill-secondary, dark-color(fill-secondary)), text colorvar(--color-tutorials-overview-content-alt), fixed padding..icon— fixed 25px square icon slot; SVG fill usesvar(--color-tutorials-overview-icon), and any stroke paths usevar(--color-tutorials-overview-content-alt)..title— tile heading,font-styles(tutorials-overview-chapter-title)..content— tile body wrapper around the nestedContentNodeoutput; un-ordered lists inside it have bullets suppressed (list-style-type: none) with a zero-width space injected viali:beforepurely to keep list semantics for assistive tech..link/.link-icon— the optional call-to-action row, colored viavar(--colors-link, var(--color-tutorials-overview-link)), with a small trailingInlineChevronRightIcon.- Breakpoint behavior: at the
smallbreakpoint everycount-Ngrid collapses to a single column (grid-template-columns: 1fr); between the "medium" and "nav-medium" breakpoints the grid is similarly forced to one column. - SCSS files involved:
ResourcesTileGroup.vue(scoped style block, the grid/count-N rules),ResourcesTile.vue(scoped style block, the card look), plus sharedsrc/styles/core/_vars.scss(tile margin) andsrc/styles/core/colors/_light.scss/_dark.scss(the color custom properties below). - CSS custom properties consumed:
--color-tutorials-overview-fill-secondary,--color-tutorials-overview-content-alt,--color-tutorials-overview-icon,--colors-link/--color-tutorials-overview-link.
5. Modern CSS-only alternative
Not applicable
Current behavior in play: none of the three components involved (ResourcesTileGroup.vue,
ResourcesTile.vue, Resources.vue) hold any component data(), watch any
reactive state, or attach any event listeners. ResourcesTileGroup.vue's only logic is a
computed countClass derived once from the static prop tiles.length, and
ResourcesTile.vue's only logic is a computed iconComponent lookup from the static
prop identifier. Both are pure, one-shot derivations from server-supplied JSON at mount time —
there is no click handler, toggle, tab switch, or any other run-time interaction to hold state for.
Because there is no interactive behavior in this kind at all — it is a static, read-only grid of link
cards — there is no state-holding mechanism (native or JS) to replace. The grid layout itself
(grid-template-columns chosen by a count-N class) is already plain CSS, not a
candidate for further "modernization" via :has(), <details>, or any other
native interactive primitive; those mechanisms exist to replace scripted state transitions, and this kind
has none.