Skip to content

Commit 77f3f19

Browse files
Add highlighted and comment props to File and Folder components
Co-Authored-By: Colton Berry <[email protected]>
1 parent 9f9117f commit 77f3f19

File tree

1 file changed

+52
-0
lines changed
  • fern/products/docs/pages/component-library/default-components

1 file changed

+52
-0
lines changed

fern/products/docs/pages/component-library/default-components/files.mdx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,42 @@ Use the `defaultOpen` property to have specific folders expanded when the page l
165165
</Files>
166166
```
167167

168+
### Highlighted files and folders with comments
169+
170+
Use the `highlighted` property to visually emphasize specific files or folders, and the `comment` property to add explanatory text that appears to the right of the item. This is useful for drawing attention to important files or providing additional context.
171+
172+
<div className="highlight-frame">
173+
<Files>
174+
<Folder name="components" defaultOpen highlighted comment="Main component directory">
175+
<File name="accordion.mdx" />
176+
<File name="button.mdx" highlighted comment="Primary button component" />
177+
<File name="card.mdx" />
178+
<File name="tabs.mdx" />
179+
</Folder>
180+
<Folder name="assets">
181+
<File name="styles.css" highlighted comment="Global styles" />
182+
</Folder>
183+
<File name="markdown.mdx" href="/learn/docs/writing-content/markdown" />
184+
<File name="README.md" highlighted comment="Start here" />
185+
</Files>
186+
</div>
187+
188+
```jsx Markdown maxLines=10
189+
<Files>
190+
<Folder name="components" defaultOpen highlighted comment="Main component directory">
191+
<File name="accordion.mdx" />
192+
<File name="button.mdx" highlighted comment="Primary button component" />
193+
<File name="card.mdx" />
194+
<File name="tabs.mdx" />
195+
</Folder>
196+
<Folder name="assets">
197+
<File name="styles.css" highlighted comment="Global styles" />
198+
</Folder>
199+
<File name="markdown.mdx" href="/learn/docs/writing-content/markdown" />
200+
<File name="README.md" highlighted comment="Start here" />
201+
</Files>
202+
```
203+
168204
## Properties
169205

170206
### `<Files>` properties
@@ -195,6 +231,14 @@ Use the `defaultOpen` property to have specific folders expanded when the page l
195231
Optional URL to make the folder name clickable. The name will show an underline on hover when a link is provided.
196232
</ParamField>
197233

234+
<ParamField path="highlighted" type="boolean" default={false}>
235+
Whether the folder should be visually highlighted. Use this to draw attention to important directories.
236+
</ParamField>
237+
238+
<ParamField path="comment" type="string" required={false}>
239+
Optional comment text that appears to the right of the folder name. Use this to provide additional context or explanations.
240+
</ParamField>
241+
198242
<ParamField path="className" type="string" required={false}>
199243
Optional CSS class name for custom styling.
200244
</ParamField>
@@ -209,6 +253,14 @@ Use the `defaultOpen` property to have specific folders expanded when the page l
209253
Optional URL to make the file name clickable. The name will show an underline on hover when a link is provided.
210254
</ParamField>
211255

256+
<ParamField path="highlighted" type="boolean" default={false}>
257+
Whether the file should be visually highlighted. Use this to draw attention to important files.
258+
</ParamField>
259+
260+
<ParamField path="comment" type="string" required={false}>
261+
Optional comment text that appears to the right of the file name. Use this to provide additional context or explanations.
262+
</ParamField>
263+
212264
<ParamField path="className" type="string" required={false}>
213265
Optional CSS class name for custom styling.
214266
</ParamField>

0 commit comments

Comments
 (0)