1.0.8 • Published 2 years ago

@meplay/react v1.0.8

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

@meplay/react

A lib of a collection of some components created by me.

Installation

npm install @meplay/react

// or

yarn add @meplay/react

// or

pnpm add @meplay/react

Table of content

CanvasIndex

An index component inspired by wechat contact.

Live Demos

see live

npm.io

Props

propdefaultrequireddescription
list-trueThe letters to render
indexOptions{width: 50,height: 300,font: 'bold 14px Arial',fillStyle: '#000'}falseOptions determine the width and height of the index canvas component, as well as the color and font of the letters rendered
effectpopupfalsebase / wechat / popup / custom
durations2000falseTime to wait until the effect fades away(not working for custom effect)
activeColorlightgreenfalseThe active color on Index when click (not working for custom effect)
className-falseClassname for the canvasWrapper
emphasizeClassName-falseClassname for the emphasize div (only works for popup mode)
onClickLetter-falseCallback to get the clicked letter for custom mode only
onDrawIndex-falseCallback to emit the drawIndex class instance so that you can customize things

Usage

import { CanvasIndex, IndexEffect } from '@meplay/react';
import '@meplay/react/style.css';

const indexList = ['A', 'B', 'C'];

export const WebContactIndex: React.FC = () => {
  return <CanvasIndex effect={'wechat'} list={indexList} />;
};
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago