Skip to content

Commit f05632c

Browse files
authored
Some documentation for using ProductAvailabilityText and a note about how Beta badges appear in the sidebar (#28913)
1 parent c9b3f5c commit f05632c

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Product availability text
3+
styleGuide:
4+
component: ProductAvailabilityText
5+
---
6+
7+
The `ProductAvailabilityText` component dynamically renders a product's lifecycle status (such as "Beta" or "Alpha") inline with the product name. It renders nothing for generally available (GA) products, so it is safe to leave in place as a product matures.
8+
9+
The `product` prop must match a file in `src/content/directory/`.
10+
11+
```mdx live
12+
import { ProductAvailabilityText } from "~/components";
13+
14+
Cloud Connector <ProductAvailabilityText product="cloud-connector" /> allows you to route matching traffic to a public cloud provider.
15+
```
16+
17+
## Props
18+
19+
| Prop | Type | Required | Default | Description |
20+
| --- | --- | --- | --- | --- |
21+
| `product` | `string` | Yes || Product slug matching a file in `src/content/directory/`. |
22+
| `parentheses` | `string` | No | `"true"` | When `"true"`, wraps the output in parentheses (for example, `(Beta)`). Set to `"false"` for the raw text. |
23+
24+
## Behavior
25+
26+
- If the product availability is **GA**, the component renders nothing.
27+
- If the product or its availability data is not found, the component renders nothing (and logs a warning at build time).

src/content/docs/style-guide/frontmatter/sidebar.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,8 @@ sidebar:
210210
- Example
211211

212212
</FileTree>
213+
214+
### Automatic "Beta" badges
215+
216+
A "Beta" badge is automatically added to sidebar links and groups whose URL matches a directory entry with a "Beta" availability status.
217+
This badge is **not** controlled by frontmatter — it is derived from the product availability data associated with the entry in `src/content/directory/`.

0 commit comments

Comments
 (0)