You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: discourage embed component for all use cases and fix broken link
- Update warnings to discourage embed for all asset types (not just videos)
- Recommend video component for videos, Download component for PDFs, img tag for images
- Fix broken link from /learn/docs/content/write-markdown to /learn/docs/writing-content/markdown
- Add notes to PDF and video sections with recommended alternatives
- Update markdown.mdx to be consistent with embed.mdx warnings
Co-Authored-By: Colton Berry <[email protected]>
Copy file name to clipboardExpand all lines: fern/products/docs/pages/component-library/default-components/embed.mdx
+9-13Lines changed: 9 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,10 @@ Embed local assets like PDFs, videos, and other media directly in your documenta
13
13
## Usage (embed video)
14
14
15
15
<Warning>
16
-
The `<embed>` component isn't well-supported on Safari and may cause compatibility issues. For embedding videos, use the `<video>` component instead, which provides better cross-browser support and more control over playback.
16
+
The `<embed>` component isn't recommended for use as it has inconsistent browser support, particularly on Safari and mobile browsers. Instead, use the recommended alternatives below for better cross-browser compatibility:
17
+
-**Videos**: Use the [`<video>` component](/learn/docs/writing-content/markdown#local-videos)
18
+
-**PDFs**: Use the `<Download>` component (see [below](#downloadable-assets))
19
+
-**Images**: Use the `<img>` tag or Markdown image syntax
17
20
</Warning>
18
21
19
22
## Properties
@@ -33,17 +36,8 @@ Embed local assets like PDFs, videos, and other media directly in your documenta
33
36
34
37
### Video file with video tag
35
38
36
-
<Warning>
37
-
The `<embed>` component isn't well-supported on Safari and may cause compatibility issues. For embedding videos, use the [`<video>` component](/learn/docs/content/write-markdown#embedding-videos) instead, which provides better cross-browser support and more control over playback. Additionally, videos with audio will automatically play when the page loads with `<embed>`.
Videos with audio will automatically play when the page loads. Using [`<video>` component](/learn/docs/content/write-markdown#embedding-videos)disables this behavior and provides more control over playback.
40
+
The `<video>` component is the recommended approach for embedding videos, providing better cross-browser support and more control over playback. Using [`<video>` component](/learn/docs/writing-content/markdown#local-videos)prevents videos with audio from automatically playing when the page loads.
47
41
</Note>
48
42
49
43
<divclassName="highlight-frame">
@@ -60,6 +54,10 @@ Embed local assets like PDFs, videos, and other media directly in your documenta
60
54
61
55
### PDF document
62
56
57
+
<Note>
58
+
For PDFs, use the `<Download>` component (see [below](#downloadable-assets)) instead of `<embed>` for better cross-browser compatibility, especially on mobile devices.
Copy file name to clipboardExpand all lines: fern/products/docs/pages/component-library/writing-content/markdown.mdx
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,20 +110,21 @@ For more details about the HTML image element and its attributes, see the [MDN d
110
110
111
111
## Embedding local assets
112
112
113
-
You can embed local assets in your Markdown pages using the [`<embed>` component](/learn/docs/content/components/embed). This is useful for displaying PDFs, images, videos, OpenAPI files, and other assets into your docs.
113
+
You can embed local assets in your Markdown pages using the [`<embed>` component](/learn/docs/writing-content/components/embed). However, the `<embed>` component isn't recommended for use due to inconsistent browser support.
114
114
115
-
For example, to embed a video, use the following Markdown:
115
+
<Warning>
116
+
The `<embed>` component isn't recommended for use as it has inconsistent browser support, particularly on Safari and mobile browsers. Instead, use these recommended alternatives:
117
+
- **Videos**: Use the `<video>` component (see [below](#local-videos))
118
+
- **PDFs**: Use a download link or the `<Download>` component
119
+
- **Images**: Use the `<img>` tag or Markdown image syntax
120
+
</Warning>
121
+
122
+
For example, if you need to embed a video, use the `<video>` component instead:
The `<embed>` component isn't well-supported on Safari and may cause compatibility issues. For embedding videos, use the `<video>` component instead (see below), which provides better cross-browser support and more control over playback.
125
-
</Warning>
126
-
127
128
### Local videos
128
129
129
130
You can embed videos in your documentation using the HTML `<video>` tag. This gives you control over video playback settings like autoplay, looping, and muting.
0 commit comments