Skip to content

gerardmarquinarubio/ReactCutout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Cutout

https://github.com/gerardmarquinarubio/ReactCutout https://www.npmjs.com/package/react-ts-cutout

React Cutout is a simple component that allows you to create a nice title cutout effect by simply invoking the component. Try on codesandbox.io.

Installation

npm i react-ts-cutout

Example usage

import Cutout from "react-ts-cutout";

export default function myComponent() {
  return (
    <Cutout src="/image.jpg" backgroundColor="white">
      <h1>Nice titles</h1>
      <h2>Made simple</h2>
    </Cutout>
  );
}

Props

src: string

Source of the background image. Required

backgroundColor : 'white' | 'black' | string;

Color of the background. Required. Accepts any CSS color notation.

mode?: Property.MixBlendMode;

Blend mode CSS property. Defaults to 'darken' or 'lighten' depending on backgroundColor.

About

React cutout component written in TypeScript with React 18

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published