1.0.27 • Published 6 months ago

react-shapeshifter v1.0.27

Weekly downloads
2
License
MIT
Repository
github
Last release
6 months ago

react-shapeshifter

A React component that is able to render various commonly used button shapes with only three lines, morphing smootly between shapes using CSS transitions.

Usage

const Shapeshifter = require('react-shapeshifter')

const App = () => (
  <Shapeshifter shape="menu" />
)

Props

The component supports the following props:

  • shape: defines the shape that the button will show. Currently supported shapes are as follows:

    • menu - a standard "hamburger"-style menu icon

    • close - a "close" icon showing an X

    • left - left-pointing arrow

    • right - right-pointing arrow

    • up - up-pointing arrow

    • down - down-pointing arrow

  • color: specifies the color of the component. You can use anything that is accepted in CSS for the background-color property.

  • thickness: the thickness of each line in the component.

  • width: the length of each line in the component when showing the "hamburger" icon. It should be set to nine times the thickness if you want nice square-shaped buttons.

  • padding: additional padding around the button, in pixels. The default settings produce 48x48 px icons, suitable for touch targets in mobile apps.

  • style: allows you to specify additional CSS properties that will be merged into the root tag of the component.

  • onClick: callback function to call when the user clicks on the component.

1.0.26

6 months ago

1.0.25

6 months ago

1.0.27

6 months ago

1.0.24

10 months ago

1.0.23

10 months ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago