-
Notifications
You must be signed in to change notification settings - Fork 210
Add View component documentation #1702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
32b60cd
9f0d2f8
32151b0
7b4bf54
130dda7
f654cd0
eeb5681
a96630f
dbd28b5
6a0c992
ee00b74
ac758c3
6a99131
2eb7809
149e1f3
0421f4d
09e2c65
d98d5b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| title: "View" | ||
| description: "Create multi-view content for different programming languages or frameworks" | ||
| --- | ||
|
|
||
| Use the View component to create content that changes based on the selected view in a multi-view dropdown. This is particularly useful for showing code examples or documentation specific to different programming languages or frameworks. | ||
|
|
||
| <View title="JavaScript" icon="js"> | ||
| This content is only visible when JavaScript is selected. | ||
|
|
||
| ```javascript | ||
| console.log("Hello from JavaScript!"); | ||
| ``` | ||
| </View> | ||
|
|
||
| <View title="Python" icon="python"> | ||
| This content is only visible when Python is selected. | ||
|
|
||
| ```python | ||
| print("Hello from Python!") | ||
| ``` | ||
| </View> | ||
|
|
||
| ## Example | ||
|
|
||
| ````mdx JavaScript and Python views | ||
| <View title="JavaScript" icon="js"> | ||
| This content is only visible when JavaScript is selected. | ||
|
|
||
| ```javascript | ||
| console.log("Hello from JavaScript!"); | ||
| ``` | ||
| </View> | ||
|
|
||
| <View title="Python" icon="python"> | ||
| This content is only visible when Python is selected. | ||
|
|
||
| ```python | ||
| print("Hello from Python!") | ||
| ``` | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </View> | ||
| ```` | ||
|
|
||
| ## Properties | ||
|
|
||
| <ResponseField name="title" type="string" required> | ||
| The title that identifies this view. Must match one of the options in the multi-view dropdown. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="icon" type="string"> | ||
| A [Font Awesome](https://fontawesome.com/icons) icon, [Lucide](https://lucide.dev/icons) icon, URL to an icon, or relative path to an icon. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="iconType" type="string"> | ||
| For Font Awesome icons only: One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`. | ||
| </ResponseField> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,7 +92,8 @@ | |
| "components/steps", | ||
| "components/tabs", | ||
| "components/tooltips", | ||
| "components/update" | ||
| "components/update", | ||
| "components/view" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Broken Multilingual Navigation for DocumentationThe
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can ignore. Locadex will update the |
||
| ] | ||
| }, | ||
| "create/reusable-snippets", | ||
|
|
@@ -549,7 +550,7 @@ | |
| ] | ||
| }, | ||
| { | ||
| "group": "Documentation de l’API", | ||
| "group": "Documentation de l'API", | ||
| "icon": "file-json", | ||
| "pages": [ | ||
| "fr/guides/migrating-from-mdx" | ||
|
|
@@ -581,10 +582,10 @@ | |
| ] | ||
| }, | ||
| { | ||
| "tab": "Référence de l’API", | ||
| "tab": "Référence de l'API", | ||
| "groups": [ | ||
| { | ||
| "group": "référence de l’API", | ||
| "group": "référence de l'API", | ||
| "icon": "file-json", | ||
| "pages": [ | ||
| "fr/api/introduction" | ||
|
|
@@ -1731,4 +1732,4 @@ | |
| "google-site-verification": "YRuJgIxsRnMkiRTYTo_tEsJSFyIE3AraEiukTbeV4Ag" | ||
| } | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.