Socket
Book a DemoInstallSign in
Socket

romaine-components

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

romaine-components

Component library for use with romaine

0.10.0
latest
npmnpm
Version published
Weekly downloads
5
400%
Maintainers
1
Weekly downloads
 
Created
Source

romaine-components

Component library for use with romaine

Installation

$ npm i romaine-components OR $ yarn add romaine-components romaine

Example

import { useEffect, useState, useMemo } from "react";
import { RomaineExample } from "romaine-components/example";
import { Romaine } from "romaine";

function App() {
  const [blob, setBlob] = useState<Blob | null>(null);
  const image = useMemo(
    () => `https://source.unsplash.com/random?unique=${Math.random()}`,
    []
  );
  useEffect(() => {
    if (blob !== null) {
      const url = window.URL.createObjectURL(blob);
      const link = document.createElement("a");
      link.href = url;
      link.setAttribute("download", "image.png"); //or any other extension
      document.body.appendChild(link);
      link.click();
    }
  }, [blob]);

  return (
    <div className="App">
      <Romaine angle={90}>
        <RomaineExample
          imageExportOptions={{ type: "image/jpeg", quality: 0.92 }}
          setBlob={setBlob}
          image={image}
        />
      </Romaine>
    </div>
  );
}

export default App;

Field Inputs

Romaine

Note:

Changing props triggers the Context Alternative, which causes an un-needed render when you can use the context alternative yourself.

ParameterTypeDescriptionDefaultContext Alternative
anglenumberTurn angle for rotation tool90setAngle(90)

Romaine Components

ParameterTypeDescriptionDefault
imageExportOptionsobjectObject given to RomaineRef.current?.getBlob() function90
setBlobfunctionsetter function give from useState hookundefined
imagestringlocation (URL or File) of the imagenull

imageExportOptions

ParameterTypeDescriptionDefault
type: "image/jpeg"stringObject given to RomaineRef.current?.getBlob() functionimage/png
qualitynumberQuality settings for image when type = image/webp OR image/jpeg0.92

Keywords

romaine

FAQs

Package last updated on 16 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.