Render (2)·续34

  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/learning-paths/zero-trust/mdm.mdx">src/content/partials/learning-paths/zero-trust/mdm.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/learning-paths/zero-trust/private-dns.mdx">src/content/partials/learning-paths/zero-trust/private-dns.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/learning-paths/zero-trust/split-tunnel-settings.mdx">src/content/partials/learning-paths/zero-trust/split-tunnel-settings.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/learning-paths/zero-trust/validate-traffic-in-gateway.mdx">src/content/partials/learning-paths/zero-trust/validate-traffic-in-gateway.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/load-balancing/monitor-create.mdx">src/content/partials/load-balancing/monitor-create.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/load-balancing/pool-create.mdx">src/content/partials/load-balancing/pool-create.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/networking-services/mnm/rules/overview.mdx">src/content/partials/networking-services/mnm/rules/overview.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/networking-services/mnm/rules/rule-notifications.mdx">src/content/partials/networking-services/mnm/rules/rule-notifications.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/pages/framework-guides/create-github-repository.mdx">src/content/partials/pages/framework-guides/create-github-repository.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/pages/framework-guides/create-github-repository_no_init.mdx">src/content/partials/pages/framework-guides/create-github-repository_no_init.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/pages/framework-guides/git-integration.mdx">src/content/partials/pages/framework-guides/git-integration.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/registrar/before-you-begin.mdx">src/content/partials/registrar/before-you-begin.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/rules/origin-rules-api-change-host-header-dns-record.mdx">src/content/partials/rules/origin-rules-api-change-host-header-dns-record.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/rules/origin-rules-api-change-port.mdx">src/content/partials/rules/origin-rules-api-change-port.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/rules/product-execution-order.mdx">src/content/partials/rules/product-execution-order.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/waf/dash-configure-rules-by-tag.mdx">src/content/partials/waf/dash-configure-rules-by-tag.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/waf/leaked-credentials-detection-enable.mdx">src/content/partials/waf/leaked-credentials-detection-enable.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/waf/managed-ruleset-config-options.mdx">src/content/partials/waf/managed-ruleset-config-options.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/waf/managed-rulesets/api-account-example.mdx">src/content/partials/waf/managed-rulesets/api-account-example.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/waf/managed-rulesets/api-zone-example.mdx">src/content/partials/waf/managed-rulesets/api-zone-example.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/workers/dash-creation-next-steps.mdx">src/content/partials/workers/dash-creation-next-steps.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/workers/prereqs.mdx">src/content/partials/workers/prereqs.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/workers/wrangler-commands/kv.mdx">src/content/partials/workers/wrangler-commands/kv.mdx</a>
  • <a href="https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/partials/workers/wrangler-commands/tunnel.mdx">src/content/partials/workers/wrangler-commands/tunnel.mdx</a>

</details>

The Render component allows us to include a "partial", a reusable Markdown snippet, onto a page.

It also accepts parameters that can be used as variables within the partial, so that even content which needs slight differences between usages can be turned into a partial.

Component

import { Render } from "~/components";

<Render
    file="simple-props"
    product="style-guide"
    params={{
        name: "world",
    }}
/>

Inputs

  • file string

This should be the name of the partial, without the containing directory or file extension. For example, /partials/style-guide/hello.mdx would be file="hello". - product string

This should be the folder within src/partials. - params object optional

If you wish to substitute values inside your partial, you can use pass params which can be referenced in your partial. Refer to properties.

Properties

Defining expected properties in frontmatter

Anything defined in the params property of the Render component is available inside the partial, using JavaScript expressions ↗︎.

To protect against required properties being missed, any partial that relies on params should also define params in the partial's frontmatter. This should be an array of strings, matching the property names you expect.

---
params:
  - product
---

Note

Partials must use params only for simple value substitution (for example, {props.name}). Do not use conditional or branching logic (such as &&, ternary ? :, or comparisons like ===) inside a partial. If content needs to differ between call sites, create a separate partial for each variation instead.

For each of the below examples, you can open the dropdown to view the partial's content.

Properties as a plain string

The below example would render Hello, world!.

<details>

<summary>

simple-props.mdx

</summary>

---
params:
  - name
---

Hello, {props.name}!

</details>

import { Render } from "~/components";

<Render file="simple-props" product="style-guide" params={{ name: "world" }} />

Properties in Markdown syntax

When using JavaScript expressions, you are now "inside JSX" and cannot use traditional Markdown syntax. Similarly, you cannot use a JavaScript expression inside Markdown syntax.

Ideally, you should not use Markdown syntax, such as **strong** or [text](link), with properties. If using JSX is not feasible, there is a Markdown component that will take a text property.

The MDX documentation ↗︎ includes a mapping of common Markdown syntax to their equivalent JSX elements.

Strong

<details>

<summary>

strong-in-props.mdx

</summary>

---
params:
  - dont
  - do
---

**Don't do this!**

{props.dont}

**Do this!**

<strong>{props.do}</strong>

</details>

import { Render } from "~/components";

<Render
    file="strong-in-props"
    product="style-guide"
    params={{ do: "Text", dont: "**Text**" }}
/>

<details>

<summary>

link-in-props.mdx

</summary>

---
params:
  - link
nimbusDisableRules:
  - nimbus/internal-link
---

**Don't do this!**

This will link to `/style-guide/build-the-page/components/%7Bprops.link%7D`.

[Markdown link]({props.link})

**Do this!**

This will link to `style-guide/components/render/#links`.

<p>
    <a href={props.link}>JSX link</a>
</p>

</details>

import { Render } from "~/components";

<Render
    file="link-in-props"
    product="style-guide"
    params={{
        link: "/style-guide/build-the-page/components/render/#links",
    }}
/>

Images

<details>

<summary>

image-in-props.mdx

</summary>

---
params:
  - image
---

**Don't do this!**

`![Alt text]({props.image})`

**Do this!**

<img src={props.image} alt="Alt text" />

</details>

import { Render } from "~/components";

<Render
    file="image-in-props"
    product="style-guide"
    params={{ image: "/logo.svg" }}
/>

Code blocks

<details>

<summary>

code-in-props.mdx

</summary>

---
params:
  - code
---

import { Code } from "~/components";

#### Inline

**Don't do this!**

`{props.code}`

**Do this!**

<p>
    <code>{props.code}</code>
</p>

<hr />

#### Codeblocks

**Don't do this!**

```js
{
    props.code;
}
```

**Do this!**

<Code code={props.code} lang="js" />

</details>

import { Render } from "~/components";

<Render
    file="code-in-props"
    product="style-guide"
    params={{ code: "export const foo = 'bar';" }}
/>

Was this helpful?

YesNo

On this page

Render (2)·续34 - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/style-guide/build-the-page/components/render/#page","headline":"Render","description":"Render reusable partial content from other files.","url":"https://developers.cloudflare.com/style-guide/build-the-page/components/render/","inLanguage":"en","image":"https://developers.cloudflare.com/style-guide/build-the-page/components/render/og.png?v=753afa1584bd702e","dateModified":"2026-08-25","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Display resources filtered by selector values. title: Resources by selector image: https://developers.cloudflare.com/style-guide/build-the-page/components/resources-by-selector/og.png?v=8fbc7958544fcb2e


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/style-guide/llms.txt
Use this file to discover all available pages before exploring further.