{"id":7137,"date":"2025-09-11T10:17:35","date_gmt":"2025-09-11T15:17:35","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=7137"},"modified":"2025-09-11T10:18:29","modified_gmt":"2025-09-11T15:18:29","slug":"the-joy-of-mixing-custom-elements-web-components-and-markdown","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/the-joy-of-mixing-custom-elements-web-components-and-markdown\/","title":{"rendered":"The Joy of Mixing Custom Elements, Web Components, and Markdown"},"content":{"rendered":"\n<p>One of the nice things about Markdown is that you can just&#8230; put HTML in there too. There is no Markdown shortcut for a <code>&lt;div&gt;<\/code>, but you can just use a <code>&lt;div&gt;<\/code>. That means you can use use <code>&lt;my-custom-element&gt;<\/code> as well, bringing the world of Web Components into your writing and creating of content. <\/p>\n\n\n\n<p><a href=\"https:\/\/deanebarker.net\/tech\/blog\/custom-elements-markdown\/\">Deane Barker writes:<\/a><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>What if you want a Markdown-friendly way to represent a feedback form, or a tabbed UI, or a mortgage calculator, or something else way beyond the scope of text formatting.<\/p>\n\n\n\n<p>For these situations, what you really want is to put a token or a placeholder in your Markdown, and have something else&nbsp;<em>expand<\/em>&nbsp;it later on into a larger, more complicated HTML construct.<\/p>\n\n\n\n<p>What you sort of need is\u2026 Markdown for More Complicated HTML\u2122.<\/p>\n\n\n\n<p>Enter&nbsp;<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Web_components\/Using_custom_elements\">Custom Elements<\/a>.<\/p>\n<\/blockquote>\n\n\n\n<p>If you want to put React components into Markdown, you&#8217;ve got <a href=\"https:\/\/mdxjs.com\/\">MDX<\/a>, but MDX can get Very Complicated\u2122. If you just want to use Web Components in Markdown, well, <a href=\"https:\/\/daverupert.com\/2023\/10\/mdx-with-web-components\/\">Dave really said it best<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the nice things about Markdown is that you can just&#8230; put HTML in there too. There is no Markdown shortcut for a &lt;div&gt;, but you can just use a &lt;div&gt;. That means you can use use &lt;my-custom-element&gt; as well, bringing the world of Web Components into your writing and creating of content. Deane [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7138,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[31,145,36],"class_list":["post-7137","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-html","tag-markdown","tag-web-components"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2025\/09\/pexels-photo-270404.jpeg?fit=1880%2C1056&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/7137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=7137"}],"version-history":[{"count":2,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/7137\/revisions"}],"predecessor-version":[{"id":7140,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/7137\/revisions\/7140"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/7138"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=7137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=7137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=7137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}