New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-connect-line

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-connect-line

You can match your react components by connecting the dots with lines.

latest
Source
npmnpm
Version
0.0.11
Version published
Maintainers
1
Created
Source

react-connect-line

You can match your react components by connecting the dots with lines.

Screenshot

스크린샷

Installation

npm install react-connect-line

Usage

import { useState, useEffect } from "react";
import { ConnectLine, ItemsProps } from 'react-connect-line';

function App() {
  const [items, setItems] = useState<ItemsProps[]>([]);
  const [isCorrectMatch, setIsCorrectMatch] = useState(false);

  useEffect(() => {
    const items = [
      {
        source: { text: "one" },
        target: { text: "1" },
      },
      {
        source: { text: "two" },
        target: { text: "2" },
      },
      {
        source: { text: "three" },
        target: { text: "3" },
      },
    ];

    setItems(items);
  }, []);

  console.log(isCorrectMatch);

  return (
    <ConnectLine
      items={items}
      setIsCorrectMatch={setIsCorrectMatch}
      containerSize={800}
      lineColor="orange"
      lineWidth={10}
      dotColor="orange"
      dotSize={46}
      fontSize={24}
    />
  );
}

export default App;

Props

PropDescriptionTypeDefault
itemsContents to connect with a lineItemsProps[]required
isLayoutUpAndDownWhether the source and target are placed top and bottombooleanfalse
setIsCorrectMatchA function to store information about whether the source and target are correctly pairedReact.Dispatch<React.SetStateAction>undefined
containerSizeSize of the ConnectLine component (height if the layout is top or bottom, width if the layout is on both sides)number100%
lineColorColor of the line connecting the dotsstringblack
lineWidthWidth of the line connecting the dotsnumber10
dotColorColor of the dotstringblack
dotSizeSize of the dot (width and height are the same)number46
textColorColor of the item's textstringblack
fontSizeSize of the item's textnumber50
imageSizeSize of the item's imagenumber300

Contributing

Contributions are always welcome!

License

MIT

Keywords

connect

FAQs

Package last updated on 24 Nov 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