diff --git a/microsite-canon/components/Snippet/index.tsx b/microsite-canon/components/Snippet/index.tsx
new file mode 100644
index 0000000000..0893eed51c
--- /dev/null
+++ b/microsite-canon/components/Snippet/index.tsx
@@ -0,0 +1,40 @@
+import { ReactNode } from 'react';
+import { CodeBlock } from '../CodeBlock';
+import { Text } from '@backstage/canon';
+import { Collapsible } from '@base-ui-components/react/collapsible';
+import styles from './styles.module.css';
+
+interface SnippetProps {
+ preview: ReactNode;
+ code: string;
+ align?: 'left' | 'center';
+ px?: number;
+ py?: number;
+ open?: boolean;
+}
+
+export const Snippet = ({
+ preview,
+ code = '',
+ align = 'left',
+ px = 2,
+ py = 2,
+ open = false,
+}: SnippetProps) => {
+ return (
+
+
+ {preview}
+
+ View code
+
+
+
+
+
+
+ );
+};
diff --git a/microsite-canon/components/Snippet/styles.module.css b/microsite-canon/components/Snippet/styles.module.css
new file mode 100644
index 0000000000..ed3faa4dcd
--- /dev/null
+++ b/microsite-canon/components/Snippet/styles.module.css
@@ -0,0 +1,37 @@
+.container {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+
+.preview {
+ border-radius: 4px;
+ box-shadow: inset 0 0 0 1px var(--canon-border-base);
+ background-color: var(--canon-background);
+ background-image: radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 0);
+ background-position: calc((8px / 2) * -1) calc((8px / 2) * -1);
+ background-size: 8px 8px;
+ position: relative;
+ transition: all 0.2s ease-in-out;
+}
+
+.center {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.trigger {
+ all: unset;
+ position: absolute;
+ right: 16px;
+ bottom: 12px;
+ cursor: pointer;
+}
+
+[data-theme='dark'] .preview {
+ background-image: radial-gradient(
+ rgba(255, 255, 255, 0.1) 1px,
+ transparent 0
+ );
+}
diff --git a/microsite-canon/content/button.mdx b/microsite-canon/content/button.mdx
index 1e205cdb3c..bed9477a17 100644
--- a/microsite-canon/content/button.mdx
+++ b/microsite-canon/content/button.mdx
@@ -1,16 +1,33 @@
-import { Story } from '../components/Story';
-import { CodeBlock } from '../components/CodeBlock';
import { PropsTable } from '../components/PropsTable';
+import { Snippet } from '../components/Snippet';
+import {
+ Button1,
+ Button2,
+ Button3,
+ Button4,
+ Button5,
+ Button6,
+} from '../snippets/button';
# Button
A button component that can be used to trigger actions.
-
-
-
Click me
-`}
+}
+ code={`
+
+
+
+`}
/>
## API reference
@@ -50,14 +67,21 @@ A button component that can be used to trigger actions.
Here's a view when buttons have different variants.
-
-
-}
code={`
-
-
-
+
+
+
`}
/>
@@ -65,10 +89,11 @@ Here's a view when buttons have different variants.
Here's a view when buttons have different sizes.
-
-
-}
code={`
@@ -79,10 +104,11 @@ Here's a view when buttons have different sizes.
Here's a view when buttons have icons.
-
-
-}
code={`
@@ -94,9 +120,11 @@ Here's a view when buttons have icons.
Here's a view when buttons are full width.
-
-
-}
code={`
`}
@@ -106,17 +134,23 @@ Here's a view when buttons are full width.
Here's a view when buttons are disabled.
-
-
-Button`} />
+}
+ code={``}
+/>
### Responsive
Here's a view when buttons are responsive.
-
-
-}
code={`