2.0.20 • Published 2 months ago

react-badger v2.0.20

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

react-badger

Simple circular badge that can be attached to some corner of its container.

Usage

const Badge = require('react-badger')

const App = () => (
  <div style={{ background: '#f5f5f5', position: 'relative' }}>
    <Badge />
  </div>
)

Props

The component supports the following props:

  • anchor: defines the corner where the badge will be anchored to in its containing component. The containing component must have relative CSS positioning (i.e. position: relative in CSS) for the badge to be positioned properly unless the anchor is set to inline, in which case the badge will appear in the document flow like any other block-inlined element. Currently supported values are: inline, topLeft, topRight, bottomLeft, and bottomRight. The default value is topRight.

  • animated: whether the badge should be animated when it appears or disappears.

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

  • offset: the offset of the badge from the corner where it is anchored to. Ignored when the anchor is set to inline. Must be an array of length 2, containing the horizontal and vertical offsets in CSS notation. (Pixel values can also be declared as numbers; percentages are allowed).

  • shadow: whether to put a drop shadow below the badge

  • visible: whether the badge is visible.

Any additional props are spread to the root <div> of the component. Children are shown directly in the generated <div>, making it possible to use children for displaying labels in the badge.

2.0.20

2 months ago

2.0.19

7 months ago

2.0.18

1 year ago

2.0.17

1 year ago

2.0.15

2 years ago

2.0.16

2 years ago

2.0.14

2 years ago

2.0.13

2 years ago

2.0.12

2 years ago

2.0.11

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago