Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
import { Box as Box, MarkdownEmbed as MarkdownEmbed } from "../components";
const Component = () => {
return (
<Box className={`w-box`}>
<MarkdownEmbed
code={
'# Styling Markdown with Markdown Embed\n\nMarkdown Embed allows styling of Markdown, which primarily comes from external data.\n\n## How to Use Markdown Embed\n\n- Every element is shown in the Navigator.\n- Apply styles and Tokens to each element.\n- Adjustments to elements apply universally within this embed, ensuring consistency across your content.\n\n---\n\n## This sample text contains all the elements that can be styled.\n\nAny elements that were not used above are used below.\n\n### Heading 3\n#### Heading 4\n##### Heading 5\n###### Heading 6\n\n[Links](#) connect your content to relevant resources.\n\n**Bold text** makes your important points stand out.\n\n*Italic text* is great for emphasizing terms.\n\n1. First Step\n2. Second Step\n\n\n\n> Capture attention with a powerful quote.\n\n> [!NOTE]\n> Add helpful context without interrupting the main content.\n\nUsing `console.log("Hello World");` will log to the console.\n\n| Header 1 | Header 2 | Header 3 |\n|------------|------------|------------|\n| Cell 1.1 | Cell 1.2 | Cell 1.3 |\n| Cell 2.1 | Cell 2.2 | Cell 2.3 |\n| Cell 3.1 | Cell 3.2 | Cell 3.3 |'
}
className={`w-markdown-embed w-alert`}
></MarkdownEmbed>
</Box>
);
};
export default {
title: "Components/MarkdownEmbed",
};
const Story = {
render() {
return (
<>
<style>
{`
@layer presets {
div.w-box {
box-sizing: border-box
}
div.w-markdown-embed {
display: contents;
white-space: normal;
white-space-collapse: collapse
}
}
@media all {
.w-alert [data-state] {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
border-bottom-left-radius: 8px;
padding: 16px
}
.w-alert [data-state][data-state="caution"] {
background-color: #fee2e2
}
.w-alert [data-state][data-state="important"] {
background-color: #eef2ff
}
.w-alert [data-state][data-state="note"] {
background-color: #eff6ff
}
.w-alert [data-state][data-state="tip"] {
background-color: #ecfdf5
}
.w-alert [data-state][data-state="warning"] {
background-color: #fef3c7
}
}
`}
</style>
<Component />
</>
);
},
};
export { Story as MarkdownEmbed };