This page details frequently used code components you can add to articles. There are additional components demonstrated at posthog.com/example-components
.
Call to action
Adding <ArrayCTA />
to any article will add this simple CTA:
Ready to find out more?
Don't overuse it, but it's useful for high intent pages, like comparisons.
Comparison tables
We used to create custom HTML tables, but we now have an easier to use component that allows us to change the styling of any table.
To use, first import the componenents by adding this code near the start, right after the frontmatter:
import { ComparisonTable } from 'components/ComparisonTable'import { ComparisonRow } from 'components/ComparisonTable/row'
Then, customize the code below to fit your needs.
<ComparisonTable column1="Company name 1" column2="Company name 2"><ComparisonHeader category="Optional header row" /><ComparisonRow column1={true} column2="Text" feature="Feature name" description="Feature description" /></ComparisonTable>
In ComparisonRow
:
- Values for
column1
andcolumn2
can be:{true}
|{false}
|"Text string"
feature
is required butdescription
can be omitted (only if not using that column for the entire table)
Here's what a comparison table looks like:
PostHog | LogRocket | |
Self-serve Free to try, no mandatory sales calls | ✔ | ✔ |
Session replay Watch real users use your product; diagnose bugs | ✔ | ✔ |
Heatmaps See where users click and interact | ✔ | ✔ |
Product analytics Custom trends, funnels, paths, and retention analysis | ✔ | ✔ |
Autocapture Capture events without manual instrumentation | ✔ | ✔ |
Group analytics Track metrics at the account or company level | ✔ | ✖ |
A/B testing Test changes and analyze their impact | ✔ | ✖ |
Performance monitoring Track core web vitals, server usage, and network performance. | ✔ | ✔ |
Error monitoring Capture exceptions and failures automatically | ✖ | ✔ |
Issue management Score issues, triage, monitor app health | ✖ | ✔ |
Alerting Set alerts on metric thresholds or anomalies | ✖ | ✔ |
Open source Build your own apps and contribute code | ✔ | ✖ |
Important: You can only use the table components in mdx
files – an extension to Markdown that lets you use JSX code in a markdown file.
Captions
You can add captions below images using the following code:
<Caption>Add you caption copy here</Caption>
Here's an example of what it looks like:
Quotation
You can add a styled quote component using the following code:
<BorderWrapper><QuoteimageSource="/images/customers/utku.jpg"size="md"name="Utku Zihnioglu"title="Founder & CEO, Webshare "quote={`“We saw PostHog, and saw that it does everything that we needed, and had all these syncing capabilities too. We just knew right away that it was the right tool for us. We started using all of its capabilities.”`}/></BorderWrapper>
It looks like this:
“We saw PostHog, and saw that it does everything that we needed, and had all these syncing capabilities too. We just knew right away that it was the right tool for us. We started using all of its capabilities.”
We mainly use them in customer stories and some product pages.