Ripple
React Bootstrap 5 Ripple
The ripple method provides a radial action in the form of a visual ripple expanding outward from the user’s touch. Ripple is a visual form of feedback for touch events providing users a clear signal that an element is being touched.
Note: Read the API tab to find all available options and advanced customization
Basic example
By default, ripple is added to every button and it does not require any additional classes or attributes.
Wrap other elements into MDBRipple
to initialize a ripple effect on them.
Colors
By using rippleColor
property you can change the color of the ripple.
You can use the colors from the basic MDB palette, for example
rippleColor="primary"
or rippleColor="danger"
:
You can also use any CSS color name:
Or simply use the hex color code:
Duration
By using rippleDuration
property you can modify the duration of the
ripple.
Centered
If you add rippleCentered
property the ripple always starts in
the center of the element instead of in the touched place.
Unbound
If you use rippleUnbound
property,the ripple won't be bonded to
the given element and it will exceed its borders.
Radius
By using rippleRadius
property you can modify the radius of the
ripple. The numeric value is expressed in pixels, for example:
rippleRadius={10}
Ripple - API
Import
Properties
MDBRipple
Name | Type | Default | Description | Example |
---|---|---|---|---|
rippleTag
|
string | 'div' |
Defines tag of the MDBRipple element |
<MDBRipple tag="span" />
|
rippleCentered
|
boolean | '' |
Centers the position of ripple |
<MDBRipple rippleCentered />
|
rippleUnbound
|
boolean | '' |
Sets whether the effect should go beyond the wrapper's boundaries |
<MDBRipple rippleUnbound />
|
rippleColor
|
string | '' |
Changes color of ripple |
<MDBRipple rippleColor="secondary" />
|
rippleRadius
|
number | '' |
Sets radius value |
<MDBRipple rippleRadius={10} />
|
rippleDuration
|
number | '' |
Sets duration of animation |
<MDBRipple rippleDuration={10} />
|