diff --git a/components/view.mdx b/components/view.mdx new file mode 100644 index 000000000..fb683039a --- /dev/null +++ b/components/view.mdx @@ -0,0 +1,58 @@ +--- +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. + + + This content is only visible when JavaScript is selected. + + ```javascript + console.log("Hello from JavaScript!"); + ``` + + + + This content is only visible when Python is selected. + + ```python + print("Hello from Python!") + ``` + + +## Example + + +```mdx JavaScript and Python views + + This content is only visible when JavaScript is selected. + + \```javascript + console.log("Hello from JavaScript!"); + \``` + + + + This content is only visible when Python is selected. + + \```python + print("Hello from Python!") + \``` + +``` + + +## Properties + + + The title that identifies this view. Must match one of the options in the multi-view dropdown. + + + + A [Font Awesome](https://fontawesome.com/icons) icon, [Lucide](https://lucide.dev/icons) icon, URL to an icon, or relative path to an icon. + + + + For Font Awesome icons only: One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`. + diff --git a/docs.json b/docs.json index 8355abedf..c816de062 100644 --- a/docs.json +++ b/docs.json @@ -92,7 +92,8 @@ "components/steps", "components/tabs", "components/tooltips", - "components/update" + "components/update", + "components/view" ] }, "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" } } -} \ No newline at end of file +}