From 801eda7fe2ec2860cec21919cb2024d5b25dc3b0 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 12:21:40 -0700 Subject: [PATCH 01/12] update accordions examples and add new page for custom components info --- content/components/accordion-groups.mdx | 2 ++ content/components/accordions.mdx | 29 ++++++++++++++++++------ content/components/custom-components.mdx | 7 ++++++ docs.json | 6 +++++ 4 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 content/components/custom-components.mdx diff --git a/content/components/accordion-groups.mdx b/content/components/accordion-groups.mdx index 29f90169c..2082cba42 100644 --- a/content/components/accordion-groups.mdx +++ b/content/components/accordion-groups.mdx @@ -18,6 +18,7 @@ Simply add `` around your existing `` components. } ``` + Check out the [Accordion](/content/components/accordions) docs for all the supported props. @@ -44,6 +45,7 @@ Simply add `` around your existing `` components. } ``` + Check out the [Accordion](/content/components/accordions) docs for all the supported props. diff --git a/content/components/accordions.mdx b/content/components/accordions.mdx index 46095e792..5b8e0d63b 100644 --- a/content/components/accordions.mdx +++ b/content/components/accordions.mdx @@ -1,22 +1,37 @@ --- title: "Accordions" -description: "A dropdown component to toggle content" +description: "A dropdown component to toggle content visibility" icon: "square-caret-down" --- - You can put any content in here. Check out - [AccordionGroup](/content/components/accordion-groups) if you want to group - multiple Accordions into a single display. + You can put any content in here, including other components, like code: + ```java HelloWorld.java + class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } + } + ``` +Check out [AccordionGroup](/content/components/accordion-groups) if you want to group multiple Accordions into a single display. + -```jsx Accordion Example +````jsx Accordion Example - You can put any content in here. + You can put any content in here, including other components, like code: + + ```java HelloWorld.java + class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } + } + ``` -``` +```` diff --git a/content/components/custom-components.mdx b/content/components/custom-components.mdx new file mode 100644 index 000000000..d578659eb --- /dev/null +++ b/content/components/custom-components.mdx @@ -0,0 +1,7 @@ +--- +title: "Custom Components" +description: "Bring your own React components to your documentation" +icon: "block-brick" +--- + +Hello World! \ No newline at end of file diff --git a/docs.json b/docs.json index 3142b96b4..4429f4f65 100644 --- a/docs.json +++ b/docs.json @@ -202,6 +202,12 @@ "content/components/update" ] }, + { + "group": "Custom Components", + "pages": [ + "content/components/custom-components" + ] + }, { "group": "API Components", "pages": [ From 637d90b30d648a0452ce7d4a9d25557806656835 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 12:29:19 -0700 Subject: [PATCH 02/12] update callouts boxes examples --- content/components/callouts.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/components/callouts.mdx b/content/components/callouts.mdx index 32cc7f082..0e1603264 100644 --- a/content/components/callouts.mdx +++ b/content/components/callouts.mdx @@ -4,6 +4,8 @@ description: 'Use callouts to add eye-catching context to your content' icon: 'circle-exclamation' --- +Callouts can be styled as notes, warnings, information, tips, or checks: + ### Note Callouts This adds a note in the content From bc1f234054e9aa8c75edcbc428924808f33db7f5 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 13:29:31 -0700 Subject: [PATCH 03/12] cards and callouts --- content/components/callouts.mdx | 2 +- content/components/card-groups.mdx | 2 +- content/components/cards.mdx | 28 ++++++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/content/components/callouts.mdx b/content/components/callouts.mdx index 0e1603264..ed7fed70f 100644 --- a/content/components/callouts.mdx +++ b/content/components/callouts.mdx @@ -4,7 +4,7 @@ description: 'Use callouts to add eye-catching context to your content' icon: 'circle-exclamation' --- -Callouts can be styled as notes, warnings, information, tips, or checks: +Callouts can be styled as a Note, Warning, Info, Tip, or Check: ### Note Callouts diff --git a/content/components/card-groups.mdx b/content/components/card-groups.mdx index 851933802..e2fbbc6c7 100644 --- a/content/components/card-groups.mdx +++ b/content/components/card-groups.mdx @@ -4,7 +4,7 @@ description: 'Show cards side by side in a grid format' icon: 'rectangles-mixed' --- -The `CardGroup` component lets you group multiple `Card` components together. It's most often used to put multiple cards on the same column. +The `CardGroup` component lets you group multiple `Card` components together. It's most often used to put multiple cards in a grid, by specifying the number of grid columns. diff --git a/content/components/cards.mdx b/content/components/cards.mdx index 6c95cd846..b05d60d4e 100644 --- a/content/components/cards.mdx +++ b/content/components/cards.mdx @@ -24,8 +24,6 @@ icon: "rectangle" ``` - - ### Horizontal Card Add a `horizontal` property to a card to make it horizontally displayed. @@ -42,6 +40,24 @@ Add an `img` property to a card to display an image on the top of the card. Here is an example of a card with an image +### Link Card + +You can customize the CTA and whether or not you show the arrow on the card. + + + This is how you use a card with an icon and a link. Clicking on this card + brings you to the Card Group page. + + + + ```jsx Card Example + + This is how you use a card with an icon and a link. Clicking on this card + brings you to the Card Group page. + + ``` + + ## Props @@ -70,4 +86,12 @@ Add an `img` property to a card to display an image on the top of the card. The url or local path to an image to display on the top of the card + + + + Label for the action button + + + + Enable or disable the link arrow icon \ No newline at end of file From cb6dcc4e07d0d8e6ad0c22fd66839645a6d989fa Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 13:53:47 -0700 Subject: [PATCH 04/12] update icons and tabs --- content/components/icons.mdx | 4 ++-- content/components/tabs.mdx | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/content/components/icons.mdx b/content/components/icons.mdx index dc688c138..8936024a6 100644 --- a/content/components/icons.mdx +++ b/content/components/icons.mdx @@ -26,11 +26,11 @@ The icon will be placed inline when used in a paragraph. ## Props - A [Font Awesome](https://fontawesome.com/icons) icon + A [Font Awesome](https://fontawesome.com/icons) or [Lucide](https://lucide.dev/icons) icon - One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands` + One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands` (only for [Font Awesome](https://fontawesome.com/icons) icons). diff --git a/content/components/tabs.mdx b/content/components/tabs.mdx index 255920e05..5ddfbe299 100644 --- a/content/components/tabs.mdx +++ b/content/components/tabs.mdx @@ -4,11 +4,18 @@ description: 'Toggle content using the Tabs component' icon: 'window-restore' --- -You can add any number of tabs. +You can add any number of tabs, and other components inside of tabs. ☝️ Welcome to the content that you can only see inside the first Tab. + ```java HelloWorld.java + class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } + } + ``` ✌️ Here's content that's only inside the second Tab. @@ -24,6 +31,13 @@ You can add any number of tabs. ☝️ Welcome to the content that you can only see inside the first Tab. + ```java HelloWorld.java + class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } + } + ``` ✌️ Here's content that's only inside the second Tab. From 92bdbc1452b4210bd2e16fc9dcc6a93b5dfe0314 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 13:54:27 -0700 Subject: [PATCH 05/12] fix tab example syntax --- content/components/tabs.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/components/tabs.mdx b/content/components/tabs.mdx index 5ddfbe299..1bf726143 100644 --- a/content/components/tabs.mdx +++ b/content/components/tabs.mdx @@ -27,7 +27,7 @@ You can add any number of tabs, and other components inside of tabs. -```jsx Tabs Example +````jsx Tabs Example ☝️ Welcome to the content that you can only see inside the first Tab. @@ -46,7 +46,7 @@ You can add any number of tabs, and other components inside of tabs. 💪 Here's content that's only inside the third Tab. -``` +```` From 02f50758ac71ef0d3d4f22820d90d9368e4154e8 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 14:51:03 -0700 Subject: [PATCH 06/12] add response fields and move reusable snippets components to components section --- content/components/custom-components.mdx | 7 --- content/components/responses.mdx | 20 +++++-- content/components/reusable-components.mdx | 65 ++++++++++++++++++++++ docs.json | 2 +- reusable-snippets.mdx | 59 -------------------- 5 files changed, 80 insertions(+), 73 deletions(-) delete mode 100644 content/components/custom-components.mdx create mode 100644 content/components/reusable-components.mdx diff --git a/content/components/custom-components.mdx b/content/components/custom-components.mdx deleted file mode 100644 index d578659eb..000000000 --- a/content/components/custom-components.mdx +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Custom Components" -description: "Bring your own React components to your documentation" -icon: "block-brick" ---- - -Hello World! \ No newline at end of file diff --git a/content/components/responses.mdx b/content/components/responses.mdx index bde833629..c5d9403c2 100644 --- a/content/components/responses.mdx +++ b/content/components/responses.mdx @@ -10,16 +10,12 @@ The `` component is designed to define the return values of an AP A response field example - - -```jsx ResponseField Example +```jsx A response field example ``` - - ## Props @@ -27,7 +23,7 @@ The `` component is designed to define the return values of an AP - Expected type of the response value + Expected type of the response value, you can also pass a custom type string @@ -37,3 +33,15 @@ The `` component is designed to define the return values of an AP Show "required" beside the field name. + + + Show "deprecated" beside the field name. + + + + Labels that are shown before the name of the field + + + + Labels that are shown after the name of the field + diff --git a/content/components/reusable-components.mdx b/content/components/reusable-components.mdx new file mode 100644 index 000000000..74ab298d0 --- /dev/null +++ b/content/components/reusable-components.mdx @@ -0,0 +1,65 @@ +--- +title: "Reusable Components" +description: "Reusable, custom component snippets" +icon: "recycle" +--- + +Much like custom content [snippets](/reusable-snippets) that can be added in MDX files, you can add reusable components as snippets. + +## Creating a reusable React component + +1. Inside your snippet file, create a component that takes in props by exporting your component in the form of an arrow function. + +```typescript snippets/custom-component.mdx +export const MyComponent = ({ title }) => ( +
+

{title}

+

... snippet content ...

+
+); +``` + + + MDX does not compile inside the body of an arrow function. Stick to HTML + syntax when you can or use a default export if you need to use MDX inside of your component. + + +2. Import the snippet into your destination file and pass in the props + +```typescript destination-file.mdx +--- +title: My title +description: My Description +--- + +import { MyComponent } from '/snippets/custom-component.mdx'; + +Lorem ipsum dolor sit amet. + + +``` + + +## Client-Side Content + +By default, Mintlify employs server-side rendering, generating content +at build time. For client-side content loading, ensure to verify the +`document` object's availability before initiating the rendering process. + +```typescript snippets/client-component.mdx +{/* `setTimeout` simulates a React.useEffect, which is called after the component is mounted. */} +export const ClientComponent = () => { + if (typeof document === "undefined") { + return null; + } else { + setTimeout(() => { + const clientComponent = document.getElementById("client-component"); + if (clientComponent) { + clientComponent.innerHTML = "Hello, client-side component!"; + } + }, 1); + + return
+ } +} +``` diff --git a/docs.json b/docs.json index 4429f4f65..e8e59216c 100644 --- a/docs.json +++ b/docs.json @@ -205,7 +205,7 @@ { "group": "Custom Components", "pages": [ - "content/components/custom-components" + "content/components/reusable-components" ] }, { diff --git a/reusable-snippets.mdx b/reusable-snippets.mdx index 0ad0ee9ee..43d5bfc7a 100644 --- a/reusable-snippets.mdx +++ b/reusable-snippets.mdx @@ -28,7 +28,6 @@ should create a custom snippet to keep your content in sync. Hello world! This is my content I want to reuse across pages. ``` - 2. Import the snippet into your destination file. ```typescript destination-file.mdx @@ -96,61 +95,3 @@ import { myName, myObject } from '/snippets/path/to/custom-variables.mdx'; Hello, my name is {myName} and I like {myObject.fruit}. ``` - -### Reusable components - -1. Inside your snippet file, create a component that takes in props by exporting - your component in the form of an arrow function. - -```typescript snippets/custom-component.mdx -export const MyComponent = ({ title }) => ( -
-

{title}

-

... snippet content ...

-
-); -``` - - - MDX does not compile inside the body of an arrow function. Stick to HTML - syntax when you can or use a default export if you need to use MDX. - - -2. Import the snippet into your destination file and pass in the props - -```typescript destination-file.mdx ---- -title: My title -description: My Description ---- - -import { MyComponent } from '/snippets/custom-component.mdx'; - -Lorem ipsum dolor sit amet. - - -``` - -### Client-Side Content - -By default, Mintlify employs server-side rendering, generating content -at build time. For client-side content loading, ensure to verify the -`document` object's availability before initiating the rendering process. - -```typescript snippets/client-component.mdx -{/* `setTimeout` simulates a React.useEffect, which is called after the component is mounted. */} -export const ClientComponent = () => { - if (typeof document === "undefined") { - return null; - } else { - setTimeout(() => { - const clientComponent = document.getElementById("client-component"); - if (clientComponent) { - clientComponent.innerHTML = "Hello, client-side component!"; - } - }, 1); - - return
- } -} -``` From 7878ca6152bd5ef7609c06f97cd2e635df299869 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 15:01:15 -0700 Subject: [PATCH 07/12] Update content/components/cards.mdx Co-authored-by: Hahnbee Lee <55263191+hahnbeelee@users.noreply.github.com> --- content/components/cards.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/components/cards.mdx b/content/components/cards.mdx index b05d60d4e..45246ee56 100644 --- a/content/components/cards.mdx +++ b/content/components/cards.mdx @@ -42,7 +42,7 @@ Add an `img` property to a card to display an image on the top of the card. ### Link Card -You can customize the CTA and whether or not you show the arrow on the card. +You can customize the CTA and whether or not to display the arrow on the card. By default, the arrow will only show for external links. This is how you use a card with an icon and a link. Clicking on this card From 2e62c005331dadc441142a88ded1d9914b53c634 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 15:01:36 -0700 Subject: [PATCH 08/12] Update content/components/responses.mdx Co-authored-by: Hahnbee Lee <55263191+hahnbeelee@users.noreply.github.com> --- content/components/responses.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/components/responses.mdx b/content/components/responses.mdx index c5d9403c2..92bc034ae 100644 --- a/content/components/responses.mdx +++ b/content/components/responses.mdx @@ -23,7 +23,7 @@ The `` component is designed to define the return values of an AP - Expected type of the response value, you can also pass a custom type string + Expected type of the response value - this can be any arbitrary string. From 0f87822db8dab24761dbacd17b06fc7a3c279017 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 15:01:52 -0700 Subject: [PATCH 09/12] Update content/components/responses.mdx Co-authored-by: Hahnbee Lee <55263191+hahnbeelee@users.noreply.github.com> --- content/components/responses.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/components/responses.mdx b/content/components/responses.mdx index 92bc034ae..53e705622 100644 --- a/content/components/responses.mdx +++ b/content/components/responses.mdx @@ -35,7 +35,7 @@ The `` component is designed to define the return values of an AP - Show "deprecated" beside the field name. + Whether a field is deprecated or not. From fb1487f0ecf88f79f247a5976d371b997c659d87 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 16:08:36 -0700 Subject: [PATCH 10/12] move accordiongroups link below props --- content/components/accordions.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/components/accordions.mdx b/content/components/accordions.mdx index 5b8e0d63b..272c1ee7b 100644 --- a/content/components/accordions.mdx +++ b/content/components/accordions.mdx @@ -15,8 +15,6 @@ icon: "square-caret-down" ```
-Check out [AccordionGroup](/content/components/accordion-groups) if you want to group multiple Accordions into a single display. - ````jsx Accordion Example @@ -57,3 +55,5 @@ Check out [AccordionGroup](/content/components/accordion-groups) if you want to One of "regular", "solid", "light", "thin", "sharp-solid", "duotone", or "brands" + +Check out [AccordionGroup](/content/components/accordion-groups) if you want to group multiple Accordions into a single display. From 4465d06694888e82f1c6450026201d4e0cc8e7c6 Mon Sep 17 00:00:00 2001 From: Kathryn Isabelle Lawrence Date: Fri, 11 Apr 2025 16:09:09 -0700 Subject: [PATCH 11/12] add props header for accordion groups --- content/components/accordion-groups.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/components/accordion-groups.mdx b/content/components/accordion-groups.mdx index 2082cba42..933fd6870 100644 --- a/content/components/accordion-groups.mdx +++ b/content/components/accordion-groups.mdx @@ -60,4 +60,6 @@ Simply add `` around your existing `` components. +## Props + `AccordionGroup` does not have any props. From aa796bd7f96b47135c31ff06d5a21b0e248087c4 Mon Sep 17 00:00:00 2001 From: Hahnbee Lee <55263191+hahnbeelee@users.noreply.github.com> Date: Sat, 12 Apr 2025 19:58:15 -0700 Subject: [PATCH 12/12] nits --- content/components/accordion-groups.mdx | 3 +- content/components/accordions.mdx | 5 +-- content/components/cards.mdx | 42 ++++++++++++++++--------- content/components/tabs.mdx | 7 +++-- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/content/components/accordion-groups.mdx b/content/components/accordion-groups.mdx index 933fd6870..87fddf9ec 100644 --- a/content/components/accordion-groups.mdx +++ b/content/components/accordion-groups.mdx @@ -19,6 +19,7 @@ Simply add `` around your existing `` components. ``` Check out the [Accordion](/content/components/accordions) docs for all the supported props. + @@ -62,4 +63,4 @@ Simply add `` around your existing `` components. ## Props -`AccordionGroup` does not have any props. +`` does not have any props. diff --git a/content/components/accordions.mdx b/content/components/accordions.mdx index 272c1ee7b..a6254b490 100644 --- a/content/components/accordions.mdx +++ b/content/components/accordions.mdx @@ -48,7 +48,8 @@ icon: "square-caret-down" - A [Font Awesome icon](https://fontawesome.com/icons), [Lucide icon](https://lucide.dev/icons), or SVG code + A [Font Awesome icon](https://fontawesome.com/icons), [Lucide + icon](https://lucide.dev/icons), or SVG code @@ -56,4 +57,4 @@ icon: "square-caret-down" "brands" -Check out [AccordionGroup](/content/components/accordion-groups) if you want to group multiple Accordions into a single display. +Use [AccordionGroup](/content/components/accordion-groups) to create a group of Accordions. diff --git a/content/components/cards.mdx b/content/components/cards.mdx index 45246ee56..b144e164d 100644 --- a/content/components/cards.mdx +++ b/content/components/cards.mdx @@ -17,16 +17,17 @@ icon: "rectangle" ``` - ```jsx Image Card Example - - Here is an example of a card with an image - - ``` +```jsx Image Card Example + + Here is an example of a card with an image + +``` + ### Horizontal Card -Add a `horizontal` property to a card to make it horizontally displayed. +Add a `horizontal` property to make it horizontally displayed. Here is an example of a horizontal card @@ -34,7 +35,7 @@ Add a `horizontal` property to a card to make it horizontally displayed. ### Image Card -Add an `img` property to a card to display an image on the top of the card. +Add an `img` property to display an image on the top of the card. Here is an example of a card with an image @@ -44,17 +45,29 @@ Add an `img` property to a card to display an image on the top of the card. You can customize the CTA and whether or not to display the arrow on the card. By default, the arrow will only show for external links. - + This is how you use a card with an icon and a link. Clicking on this card brings you to the Card Group page. ```jsx Card Example - - This is how you use a card with an icon and a link. Clicking on this card - brings you to the Card Group page. - + + This is how you use a card with an icon and a link. Clicking on this card + brings you to the Card Group page. + ``` @@ -65,7 +78,8 @@ You can customize the CTA and whether or not to display the arrow on the card. B - A [Font Awesome icon](https://fontawesome.com/icons), [Lucide icon](https://lucide.dev/icons), or SVG code in `icon={}` + A [Font Awesome icon](https://fontawesome.com/icons), [Lucide + icon](https://lucide.dev/icons), or SVG code in `icon={}` @@ -94,4 +108,4 @@ You can customize the CTA and whether or not to display the arrow on the card. B Enable or disable the link arrow icon - \ No newline at end of file + diff --git a/content/components/tabs.mdx b/content/components/tabs.mdx index 1bf726143..2c0a89736 100644 --- a/content/components/tabs.mdx +++ b/content/components/tabs.mdx @@ -1,7 +1,7 @@ --- -title: 'Tabs' -description: 'Toggle content using the Tabs component' -icon: 'window-restore' +title: "Tabs" +description: "Toggle content using the Tabs component" +icon: "window-restore" --- You can add any number of tabs, and other components inside of tabs. @@ -9,6 +9,7 @@ You can add any number of tabs, and other components inside of tabs. ☝️ Welcome to the content that you can only see inside the first Tab. + You can add any number of components inside of tabs. ```java HelloWorld.java class HelloWorld { public static void main(String[] args) {