1.2.0 • Published 10 months ago

sakana-react v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

🐟「Sakana! React!]

English | 简体中文

NPM

sakana-react is a widget react component built with react-spring.

https://bbf-blog.netlify.app/

Features

  • Build in takina and chisato character and use your own custom character.
  • Drag the character and release it, it will jump back and forth around the character.
  • Use controler to move your component and change character.
  • Support custom controller.
  • Auto resizing support.

Usage

First install the package by npm or yarn.

npm i sakana-react
// or
yarn add sakana-react

Use in React component

import SakanaReact from 'sakana-react'

const App = () => {

  return (
    <SakanaReact />
  )
}

API

PropertyDescriptionTypeDefault
widthWidth of the componentstring | number200
characterSizeSize of character imgstring | number80%
showLineWhether the line that connection between character and center is visible or notbooleantrue
lineWidthWidth of the linenumber4
strokeStyleCanvas stroke settingsstring#333
styleThe style of the wrapper domCSSProperties-
classNameThe class name of the wrapper domstring-
characterBuild in character image pathtakina | chisato-
defaultCharacterDeafult character image pathtakina | chisatotakina
customCharacterCustom character image pathstring-
onControlerClickSet the handler to handle controler click event() => void-
controlerSizeSize of Controlernumber | string26
customControlerCustom controlerReactNode-
showControlerWhether the controler is visible or notbooleantrue

License

MIT

Image source: 大伏アオ @blue00f4 pixiv

1.2.0

10 months ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago