@darshanpatel2608/human-body-react
TypeScript icon, indicating that this package has built-in type declarations

1.2.9 • Public • Published

@darshanpatel2608/human-body-react

Build one Human Body figure inyour web Page using React. Show the parts you want and click on them to select it.

Body Preview

Props

Name Type Description Default
partsInput object Parts Parameters None
onChange function Function trigger on change in parts, gives one argument parts None
onClick function Function trigger on click in parts, gives one argument id of clicked part None
mode string missing | pain, Mode of operation: missing mode is smart mode pain
height string Height of body div 510px
width string Width of body div 207px

Parts Params

Name Type Description Default
selected boolean Body Part is selected or not false
clickable boolean Body Part can be selected or not true
show boolean Body Part is visible or not true
custom values any Any other value param to be used (can be retrived with onChange) ...

Body Parts

head chest stomach left_shoulder
left_arm left_hand right_shoulder left_leg_lower
right_arm right_hand left_leg_upper left_foot
right_leg_upper right_leg_lower right_foot

How to use it

const exampleParams = {
  head: { selected: true },
  left_arm: { show: false }
}

export const App: VFC = () => {
  const [params, setParams] = useState<any>()
  return (<div>
      <BodyComponent partsInput={params} />
    )}
  </div>
  )
}

By: Darshan Patel

LinkedIN: Darshan Patel

Package Sidebar

Install

npm i @darshanpatel2608/human-body-react

Weekly Downloads

41

Version

1.2.9

License

MIT

Unpacked Size

389 kB

Total Files

20

Last publish

Collaborators

  • darshanpatel2608