You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 81d783e
Browse filesBrowse the repository at this point in the historyBrowse files
<divclass="landing-appearance-sample" r-if="component === 'ComparisonFeature'"><ulclass="m-0 p-0"><ComparisonFeature:tone="sample.tone"><span>One shared theme<br/><small>Across every screen.</small></span></ComparisonFeature></ul></div>
44
+
<divclass="landing-appearance-sample" r-if="component === 'CtaSection'"><CtaSection:tone="sample.tone" :variant="sample.variant" title="Make it yours" subtitle="Start with a useful pattern." primaryLabel="Explore" primaryHref="/components/" meta="Bring your own content."/></div>
<ComponentHeadername="CodeShowcase"kind="Code and result"summary="Pair a code block with its visible result and the context needed to understand both."source="https://github.com/PureStackStudio/PureStack/blob/main/packages/ts-components/src/standard/landing/landingTypes.ts"section="Landing & pricing"sectionHref="/components/landing/"/>
23
17
24
18
## Code and its result
25
19
26
20
Write a normal fenced code block in the default slot. ts-ssg highlights it automatically; the result slot renders the matching component.
27
21
28
22
<Tabsgroup="code-showcase-sample-1"selectedTab="code-showcase-sample-1-preview"ariaLabel="Code and its result example"tone="neutral"variant="surface"tabVariant="underline">
<ComponentExamplelabel="Code alone, a title, or result metadata"caption="Either resultTitle or resultMeta enables the result slot. language is a visible badge; syntax highlighting comes from MDX fenced code.">
112
+
<divclass="component-appearance-grid">
113
+
<divclass="component-appearance-cell"><code>Code only</code><CodeShowcasetitle="A named value"summary="No result panel needed."language="TypeScript"><pre><code>const status = 'ready'</code></pre></CodeShowcase></div>
114
+
<divclass="component-appearance-cell"><code>Result title only</code><CodeShowcasetitle="Status label"resultTitle="Preview"><pre><code><Badge>Ready</Badge></code></pre><template#result><Badgetone="success">Ready</Badge></template></CodeShowcase></div>
| tone, variant | Complete galleries above, with all supported values visible together. |
124
+
| eyebrow, title, summary | The original code-and-result example introduces the purpose of the snippet. |
125
+
| language | MDX and TypeScript badges label the snippets; the title-only result sample omits the language badge. |
126
+
| resultTitle, resultMeta | Compare code-only, title-only result, metadata-only result, and the original result with both fields. |
127
+
| Default and result slots | The default slot holds code; the named result slot holds live rendered content. A result heading or metadata is required to show that panel. |
128
+
| Native attributes and events | Pass attributes through the root; keyboard behavior belongs to the composed native controls. |
129
+
130
+
This component exposes tone and variant, but no variantMode. Style individual child components explicitly when their appearance should match.
131
+
92
132
## Behavior and accessibility
93
133
94
134
The language prop is a badge, not a syntax-highlighting engine. ts-ssg highlights fenced code in MDX automatically. A result slot is rendered only when resultTitle or resultMeta is present. Keep results keyboard-accessible when they contain controls.
@@ -149,8 +189,6 @@ The language prop is a badge, not a syntax-highlighting engine. ts-ssg highlight
149
189
<p><strong>Default slot:</strong> code or other explanatory content. <strong>result:</strong> rendered example. Register defineCodeShowcaseComponent with Panel, Flex, SectionHeader and Badge.</p>
0 commit comments