Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

Conditional rendering

<If> (alias <Conditional>) renders content only for certain languages, versions or products.

Renders its children only for the current page's locale, version, or product (alias <Conditional>), without adding any wrapper element:

<If locales={["zh"]}>Only on Chinese pages.</If>
<If locales={["en"]}>Only on English pages.</If>
<If versions={["v0"]}>Only in v0.</If>
<If products={["sdk"]} not>Everywhere except the SDK product.</If>
This tip only appears on English pages.
localesstring[]
Locale codes (languages and lang also work).
versionsstring[]
Version ids, slugs, or display names.
productsstring[]
Product ids, slugs, or display names.
notbooleanDefault false
Negate the condition.
rolesstring[]
Show content by reader role. Static builds have no logged-in user, so it never matches.

When multiple conditions are set, all of them must match.