1.0.8 • Published 12 months ago

@meplay/react v1.0.8

Weekly downloads
-
License
-
Repository
github
Last release
12 months 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

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago