1 contributor
Like
Install clamp as a package?
Copied
npm i @bit/justin-capalbo.ramda.clamp
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
modifieddraft
chevron_left
chevron_right
clamp (
minimum:
Number
,maximum:
Number
,value:
) : Number
Number
Restricts a number to be within a range.
Also works for other ordered types such as Strings and Dates.
Example
Arguments
minimum:
Number
The lower limit of the clamp (inclusive)
maximum:
Number
The upper limit of the clamp (inclusive)
value:
Number
Value to be clamped
Returns
Number
Returns `minimum` when `val < minimum`, `maximum` when `val > maximum`, returns `val` otherwise