Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

docs(open-knowledge): address Toggle docs review (#3183)

Abrahambce19268d72e
diff --git a/docs/content/reference/components/accordion.mdx b/docs/content/reference/components/accordion.mdx
index 51ab289bb..3e35eafeb 100644
--- a/docs/content/reference/components/accordion.mdx
+++ b/docs/content/reference/components/accordion.mdx
@@ -25,12 +25,12 @@ keywords: "accordion, expandable, details, disclosure, collapse, fold"
<TypeTable
type={{
"title": {
- description: "Accordion heading shown inside the <summary>",
+ description: "Heading shown inside the <summary>",
type: "string",
required: true,
},
"defaultOpen": {
- description: "When true, the accordion renders expanded on initial load",
+ description: "When true, the block renders expanded on initial load",
type: "boolean",
required: false,
default: "false",
diff --git a/docs/content/reference/components/html-align-block.mdx b/docs/content/reference/components/html-align-block.mdx
new file mode 100644
index 000000000..4239094b5
--- /dev/null
+++ b/docs/content/reference/components/html-align-block.mdx
@@ -0,0 +1,32 @@
+---
+title: "Align block"
+description: "GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip"
+keywords: "align, center, centered, div"
+---
+
+## Example
+
+```mdx
+<HtmlAlignBlock>
+ Content goes here.
+</HtmlAlignBlock>
+```
+
+## Props
+
+<TypeTable
+ type={{
+ "align": {
+ description: "Block alignment from the \\`<div align>\\` attribute.",
+ type: "'center' | 'left' | 'right' | 'justify'",
+ required: false,
+ default: "center",
+ },
+}}
+/>
+
+_Also matches:_ `align`, `center`, `centered`, `div`
+
+## Author it
+
+Type `/align` in the editor to insert it from the slash menu, or write the tag directly in source mode. The Properties panel on the right of the editor exposes every prop above as a form field once the block is selected.
diff --git a/docs/content/reference/components/meta.json b/docs/content/reference/components/meta.json
index 67d7cbcfa..6ebd4003b 100644
--- a/docs/content/reference/components/meta.json
+++ b/docs/content/reference/components/meta.json
@@ -6,6 +6,7 @@
"callout",
"accordion",
"toggle",
+ "html-align-block",
"tabs",
"math",
"mermaid-fence",
@@ -15,7 +16,6 @@
"pdf",
"file",
"embed",
- "mirror",
- "html-align-block"
+ "mirror"
]
}
diff --git a/docs/content/reference/components/toggle.mdx b/docs/content/reference/components/toggle.mdx
index c9164cb32..0b788a981 100644
--- a/docs/content/reference/components/toggle.mdx
+++ b/docs/content/reference/components/toggle.mdx
@@ -9,8 +9,8 @@ keywords: "toggle, collapsible, expand, details, disclosure, fold"
<ComponentPreview>
<AccordionPreview title="Show me the details" description="Click to expand" icon="lucide:BookOpen">
Native `<details>` under the hood — same substrate as the app render.
- Pass a shared `name` to sibling accordions and the browser will keep
- only one open at a time.
+ A standalone expand/collapse block; use `<Accordion>` with a shared
+ `name` when you need mutually-exclusive siblings.
</AccordionPreview>
</ComponentPreview>
@@ -25,12 +25,12 @@ keywords: "toggle, collapsible, expand, details, disclosure, fold"
<TypeTable
type={{
"title": {
- description: "Accordion heading shown inside the <summary>",
+ description: "Heading shown inside the <summary>",
type: "string",
required: true,
},
"defaultOpen": {
- description: "When true, the accordion renders expanded on initial load",
+ description: "When true, the block renders expanded on initial load",
type: "boolean",
required: false,
default: "false",
diff --git a/docs/scripts/generate-component-docs.ts b/docs/scripts/generate-component-docs.ts
index 535f39515..1f02d91a7 100644
--- a/docs/scripts/generate-component-docs.ts
+++ b/docs/scripts/generate-component-docs.ts
@@ -29,6 +29,7 @@ const PAGE_ORDER = [
'Callout',
'Accordion',
'Toggle',
+ 'HtmlAlignBlock',
'Tabs',
'Math',
'MermaidFence',
@@ -277,8 +278,8 @@ const PREVIEWS: Partial<Record<string, string>> = {
Toggle: `<ComponentPreview>
<AccordionPreview title="Show me the details" description="Click to expand" icon="lucide:BookOpen">
Native \`<details>\` under the hood — same substrate as the app render.
- Pass a shared \`name\` to sibling accordions and the browser will keep
- only one open at a time.
+ A standalone expand/collapse block; use \`<Accordion>\` with a shared
+ \`name\` when you need mutually-exclusive siblings.
</AccordionPreview>
</ComponentPreview>`,
Tabs: `<ComponentPreview>
@@ -368,7 +369,6 @@ function placeholderBody(name: string): string {
return '<Tab label="First">First panel</Tab>\n <Tab label="Second">Second panel</Tab>';
if (name === 'Tab') return 'Panel body content.';
if (name === 'Accordion') return 'Body content — hidden until the summary is clicked.';
- if (name === 'Toggle') return 'Body content — hidden until the summary is clicked.';
if (name === 'Callout') return 'Content of the callout goes here.';
if (name === 'MirrorSource') return 'The canonical content this block owns.';
return 'Content goes here.';
diff --git a/packages/core/src/registry/built-ins.ts b/packages/core/src/registry/built-ins.ts
index 195bd3e51..bf96e81b4 100644
--- a/packages/core/src/registry/built-ins.ts
+++ b/packages/core/src/registry/built-ins.ts
@@ -691,14 +691,14 @@ const accordionProps: PropDef[] = [
name: 'title',
type: 'string',
required: true,
- description: 'Accordion heading shown inside the <summary>',
+ description: 'Heading shown inside the <summary>',
},
{
name: 'defaultOpen',
type: 'boolean',
required: false,
defaultValue: false,
- description: 'When true, the accordion renders expanded on initial load',
+ description: 'When true, the block renders expanded on initial load',
},
// advanced — custom icon override, subtitle, deep-link anchor, exclusive-
// group identifier. All taste-and-edge-case territory; default rendering