Skip to content

Conversation

@jamiehenson
Copy link
Member

@jamiehenson jamiehenson commented Nov 28, 2025

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

coderabbitai bot commented Nov 28, 2025

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-redesign November 28, 2025 14:06
@jamiehenson jamiehenson force-pushed the web-4684-docs-redesign branch from 6015277 to 5c1e160 Compare November 28, 2025 14:07
@jamiehenson jamiehenson added the review-app Create a Heroku review app label Nov 28, 2025
@ably-ci ably-ci temporarily deployed to ably-docs-web-4801-admo-cxtljx November 28, 2025 14:08 Inactive
@@ -0,0 +1,160 @@
---
Copy link
Member Author

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
Member Author

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 jamiehenson force-pushed the web-4801-admonitions-tables branch from 616baab to 5f97a6b Compare November 28, 2025 14:14
@jamiehenson jamiehenson temporarily 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
jamiehenson and others added 2 commits December 2, 2025 13:25
@jamiehenson jamiehenson force-pushed the web-4801-admonitions-tables branch from 5f97a6b to 4d66a25 Compare December 2, 2025 13:26
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4801-admo-cxtljx December 2, 2025 13:26 Inactive
Copy link
Contributor

@aralovelace aralovelace left a comment

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
Member Author

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

Copy link
Contributor

@aralovelace aralovelace left a comment

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 jamiehenson force-pushed the web-4801-admonitions-tables branch from 4d66a25 to 9368377 Compare December 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-redesign Dec 3, 2025
7 checks passed
@jamiehenson jamiehenson deleted the web-4801-admonitions-tables branch December 3, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

4 participants