22title : Render
33---
44
5- import { Steps } from " ~/components"
5+ import { Steps } from " ~/components" ;
66
77The ` Render ` component allows us to include a "partial", a reusable Markdown snippet, onto a page.
88
@@ -12,7 +12,7 @@ which needs slight differences between usages can be turned into a partial.
1212## Component
1313
1414``` mdx live
15- import { Render } from " ~/components"
15+ import { Render } from " ~/components" ;
1616
1717<Render file = " hello" params = { {
1818 name: " world" ,
@@ -34,13 +34,13 @@ Hello <code>{props.name}</code>
3434### Inputs
3535
3636** file** ` string ` : This should be the name of the partial, without the containing directory or file extension.
37- For example, ` /partials/style-guide/hello.mdx ` would be ` file="hello" ` .
37+ For example, ` /partials/style-guide/hello.mdx ` would be ` file="hello" ` .
3838
3939** product** ` string ` (optional): By default, it will look for partials in the same product folder as the current page.
40- You can use this to specify a different product.
40+ You can use this to specify a different product.
4141
4242** params** ` object ` (optional): If you wish to substitute values inside your partial, you can use pass params which can be
43- referenced in your partial. Refer to [ params] ( #params ) .
43+ referenced in your partial. Refer to [ params] ( #params ) .
4444
4545## Partials
4646
@@ -51,20 +51,28 @@ will be thrown.
5151``` mdx title="/src/content/partials/style-guide/hello.mdx"
5252---
5353params:
54- - name
54+ - name
55+ - foo
56+ - bar
5557---
5658
5759Hello, { props .name } !
60+
61+ Hello, { props .foo } !
62+
63+ Hello, { props .bar } !
5864```
5965
6066### Params
6167
6268In the above example, you will notice there is:
6369
6470<Steps >
65- 1 . A ` params ` input on the ` Render ` component
66- 2 . A ` params ` property in the frontmatter.
71+
72+ 1 . A ` params ` input on the ` Render ` component.
73+ 2 . A ` params ` property in the frontmatter.
67743 . A reference to ` props.name ` .
75+
6876</Steps >
6977
7078#### Input
@@ -80,4 +88,4 @@ your partial requires parameters to be passed, and none are passed, we can warn
8088#### Props
8189
8290The way that you can access these parameters is with the ` props ` object, surrounded in curly braces ` {} ` .
83- This is a [ JavaScript expression within MDX] ( https://mdxjs.com/docs/using-mdx/#props ) .
91+ This is a [ JavaScript expression within MDX] ( https://mdxjs.com/docs/using-mdx/#props ) .
0 commit comments