Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions fern/products/docs/pages/changelog/2026-01-17.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Products and versions props for If component

The `<If>` component now supports `products` and `versions` props, allowing you to conditionally show content based on where a page is located within the navigation structure.

```jsx Markdown
<If products={["api-reference"]}>
This content only shows in the api-reference product
</If>

<If versions={["v2", "v3"]}>
This content only shows in v2 or v3
</If>

<If products={["docs"]} versions={["v2"]}>
All conditions must match (AND logic)
</If>
```

You can also use the `not` prop to invert the condition, showing content when the current product or version does not match.

Learn more about the [If component](/learn/docs/authentication/rbac#access-control-within-mdx-pages).