Content & Typography Shortcodes
Documentation and live specimens for callouts, code blocks, figures, status tags, tooltips, audio narration, math typesetting, and the AI modifier.
Content shortcodes enhance prose readability with callouts, syntax-highlighted code snippets, captioned figures, status badges, mathematical notation, and AI transparency modifiers.
1. Carbon AI Label (ai-label)
The ai-label shortcode implements the official IBM Carbon Design System v11 AILabel component (cds--ai-label). It provides a standardized mechanism to disclose AI-synthesized or assisted text.
When clicked, the badge opens an explainability popover dialog detailing why and how the content was produced.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
text | String | Optional | Explanation text inside the popover |
heading | String | "AI-generated content" | Title inside the popover dialog |
size | String | "sm" | Size variant (xs, sm, md, lg) |
inline | Boolean | false | When true, displays as a compact inline token |
Standalone Example
AI-generated content
This summary text was generated by an AI model to illustrate how technical writers can provide full explainability for machine-assisted drafts.
| |
Paired Shortcode Example
AI Content Notice
This section contains synthetic data generated using a large language model to test table pagination and sorting behaviors without relying on private datasets.
| |
2. Callouts & Editorial Asides (callout)
The callout shortcode highlights crucial context, warnings, tips, and AI disclosures.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
type | String | "info" | Callout type (info, success, warning, error, ai) |
title | String | Optional | Header title for the callout |
closeable | Boolean | false | When true, implements the official Carbon React ActionableNotification with an accessible close button |
actionText | String | Optional | Label for action button (converts to ActionableNotification) |
actionHref | String | Optional | Target link URL for the action button |
lowContrast | Boolean | false | When true, displays lower contrast container styling |
hide_icon | Boolean | false | When true, hides the leading status icon |
Examples
git submodule update --init --recursive when cloning for the first time. This notification is dismissible via the close button.type="ai" modifier, rendering Carbon’s purple accent border and AI icon to signal synthesized documentation prose. | |
3. Code Snippets & File Viewers (code-snippet, code-file)
Code Snippet (code-snippet)
Renders a terminal or code block with one-click clipboard copying.
| |
Code File Viewer (code-file)
Renders a labeled file viewer displaying file path, line count, and a copy button:
baseURL: "https://example.org/"
title: "Production Portal"
theme: "hugo-theme-carbon"
params:
carbon:
useLocalFonts: true
defaultThemeMode: "system"
| |
4. Status Tags (tag)
Tags categorize content and convey status. They map directly to Carbon tag color tokens.
Examples
| |
5. Tooltips (tooltip)
Tooltips provide contextual definitions or extra information on hover and focus.
| |
6. Mathematical Typesetting (math)
The math shortcode renders mathematical equations via KaTeX using self-hosted IBM Plex Math OpenType fonts without runtime network latency:
| |
7. Read-Aloud Audio Player (read-aloud)
The read-aloud shortcode provides accessibility audio narration using the browser’s native SpeechSynthesis API:
| |