0.0.2 • Published 3 years ago

@code-editor/vanilla-preview v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Vanilla preview

Executable web view of the design (vanilla)

npm.io

Installation

yarn add @code-editor/vanilla-preview

Usage

See the real example on assistant.

import VanillaPreview from "@code-editor/vanilla-preview";

export default function () {
  const _DEFAULT_MARGIN = 12;
  const _DEFAULT_SHADOW = "0px 4px 64px rgba(160, 160, 160, 0.18)";
  const _DEFAULT_BORDER_RADIUS = 4;

  return (
    <VanillaPreview
      {...previewInfo}
      margin={_DEFAULT_MARGIN}
      borderRadius={_DEFAULT_BORDER_RADIUS}
      boxShadow={_DEFAULT_SHADOW}
    />
  );
}

Disable overflow

Scaling

Autoscale with margin value (horizontal margin)

Todo: Cached preview for optimization

while repositioning, rescaling the html iframe with large content, it may be more performant to cache the preview and use them while transition is happening.

Used by

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago