Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(examples): setup StackBlitz component #2

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/components/stack-blitz.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const StackBlitz = (props: {
name: string
height?: number
view?: 'preview' | 'editor'
openFile?: string
hideExplorer?: boolean
showDevtools?: boolean
}) => {
return (
<iframe
src={`https://stackblitz.com/edit/${props.name}?embed=1&hideExplorer=${
props.hideExplorer ? 1 : 0
}&file=${props.openFile}&view=${props.view}&devToolsHeight=${
props.showDevtools ? '50' : '0'
}`}
height={props.height || 600}
style={{ width: '100%', borderRadius: '7px', margin: '2em 0' }}
/>
)
}
5 changes: 5 additions & 0 deletions docs/pages/examples/vanilla-javascript.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { StackBlitz } from '../../components/stack-blitz'

# Vanilla JS Example

<StackBlitz name="js-1sexbs" openFile="Input/Input.tsx" />
Loading