Skip to content
This repository was archived by the owner on Aug 10, 2026. It is now read-only.

[WEB-4801] Add Admonition and Table MDX components - #2989

Merged
jamiehenson merged 3 commits into
web-4684-docs-redesignfrom
web-4801-admonitions-tables
Dec 3, 2025
Merged

[WEB-4801] Add Admonition and Table MDX components#2989
jamiehenson merged 3 commits into
web-4684-docs-redesignfrom
web-4801-admonitions-tables

Conversation

@jamiehenson

@jamiehensonjamiehenson commented Nov 28, 2025

Copy link
Copy Markdown
Member

Human preamble

Adds the Admonition and Table components for use in MDX templates. Table replaces the previous tables.tsx component, and Admonition is brand new. Look at the test-mdx-components.mdx file for usage examples.

To test, take a look at: https://ably-docs-web-4801-admo-cxtljx.herokuapp.com/docs/test-mdx-components

Admonitions on the test page:
Screenshot 2025-11-28 at 14 15 38

Tables on the test page:
Screenshot 2025-11-28 at 14 15 46

Summary

This PR adds two new MDX components for use in our documentation:

  • Admonition component: Color-based callout boxes with variants (neutral, blue, green, red, yellow)
  • Table component: Radix Themes-style table with proper styling and rounded corners

Changes

  • Added Admonition.tsx with 5 color variants, optional titles, and dark mode support
  • Added Table.tsx with composition API (Table.Root, Table.Header, Table.Body, etc.)
  • Updated MDXWrapper.tsx to register both new components
  • Removed old tables.tsx and replaced with new Table component
  • Added test page to showcase all component variants

Component Features

Admonition

  • Color variants: neutral, blue, green, red, yellow
  • Optional custom titles
  • Inline title and content layout
  • Full dark mode support
  • Rounded corners with left border

Table

  • Radix Themes-style composition pattern
  • Proper border-radius with border-separate spacing
  • Responsive with horizontal scrolling
  • Works with or without header rows
  • Dark mode support

Test Plan

  • View test page at /docs/test-mdx-components
  • Verify all admonition variants render correctly
  • Verify tables with and without headers render correctly
  • Verify GFM table syntax works with new components

🤖 Generated with Claude Code

@coderabbitai

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch web-4801-admonitions-tables

Comment @coderabbitai help to get the list of available commands and usage tips.

@jamiehenson
jamiehenson changed the base branch from main to web-4684-docs-redesignNovember 28, 2025 14:06
@jamiehensonjamiehenson added the review-app Create a Heroku review app label Nov 28, 2025
@ably-ci
ably-citemporarily deployed to ably-docs-web-4801-admo-cxtljx November 28, 2025 14:08 Inactive
@@ -0,0 +1,160 @@
---

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is purely to demonstrate the new components, it will be deleted prior to merge.

@@ -0,0 +1,124 @@
import React from 'react';

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Predominantly generated by Claude but with Radix as a very close guide.

@jamiehenson
jamiehensonforce-pushed the web-4801-admonitions-tables branch from 616baab to 5f97a6bCompareNovember 28, 2025 14:14
@jamiehenson
jamiehensontemporarily deployed to ably-docs-web-4801-admo-cxtljx November 28, 2025 14:14 Inactive
@jamiehenson
jamiehenson marked this pull request as ready for review November 28, 2025 14:25
jamiehensonand others added 2 commits December 2, 2025 13:25
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
@jamiehenson
jamiehensonforce-pushed the web-4801-admonitions-tables branch from 5f97a6b to 4d66a25CompareDecember 2, 2025 13:26
@jamiehenson
jamiehensontemporarily deployed to ably-docs-web-4801-admo-cxtljx December 2, 2025 13:26 Inactive

@aralovelacearalovelace left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I played around with the table and adding more th and it will look like this? how should it looks like when its longer than its width?

Image

@jamiehenson

Copy link
Copy Markdown
MemberAuthor

@aralovelace isn't this just a corrupted table though? There shouldn't ever be more <th>s than <td>s

@aralovelacearalovelace left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh yes its just need data in the body yes looks good to me

@jamiehenson
jamiehensonforce-pushed the web-4801-admonitions-tables branch from 4d66a25 to 9368377CompareDecember 3, 2025 12:52
@jamiehenson
jamiehenson temporarily deployed to ably-docs-web-4801-admo-cxtljx December 3, 2025 12:52 Inactive
@jamiehenson
jamiehenson merged commit 382e677 into web-4684-docs-redesignDec 3, 2025
7 checks passed
@jamiehenson
jamiehenson deleted the web-4801-admonitions-tables branch December 3, 2025 13:04
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

review-appCreate a Heroku review app

Development

Successfully merging this pull request may close these issues.

3 participants

@jamiehenson@aralovelace@ably-ci