Skip to content

Commit c38b393

Browse files
[Style guide] Added more vars (#17296)
* added more vars * updated several vars * corrected to 2 spaces * Update src/content/docs/style-guide/components/render.mdx Co-authored-by: Pedro Sousa <[email protected]> --------- Co-authored-by: Pedro Sousa <[email protected]>
1 parent 43840fa commit c38b393

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/content/docs/style-guide/components/render.mdx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Render
33
---
44

5-
import { Steps } from "~/components"
5+
import { Steps } from "~/components";
66

77
The `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
---
5353
params:
54-
- name
54+
- name
55+
- foo
56+
- bar
5557
---
5658

5759
Hello, {props.name}!
60+
61+
Hello, {props.foo}!
62+
63+
Hello, {props.bar}!
5864
```
5965

6066
### Params
6167

6268
In 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.
6774
3. 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

8290
The 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

Comments
 (0)