@segersniels/window
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

@segersniels/window

Actionsnpm

screenshot

Demo

You can view it in action on my blog.

Usage

react-markdown

Use it in combination with react-markdown to nicely present code to the user.

import Window from '@segersniels/window';
import ReactMarkdown from 'react-markdown';

...

<ReactMarkdown
  source={source}
  renderers={{
    code: Window,
  }}
/>

...

Custom usage

Use it independently and pass whatever children you want to it. Please note that when passing children you will not have syntax highlighting enabled.

<Window>
  <p>Hello World!</p>
</Window>

However you can pass your own code to the value prop directly and control the language by passing the language prop. This will override any children passed.

<Window value='const foo = "bar";' language="javascript" />

custom

Package Sidebar

Install

npm i @segersniels/window

Weekly Downloads

4

Version

1.0.9

License

ISC

Unpacked Size

9.63 kB

Total Files

11

Last publish

Collaborators

  • segersniels