Link

Stepper Pattern

Stepper is a hypermedia control that presents a small-range value, such as like item quantity or meeting duration, and offers affordances to increment and decrement that value. The Stepper pattern has a Stepper resource that contains the value to modify. Two Action resources increment or decrement the value when they are triggered. These return a Location header pointing back to the modified Stepper resource.

Stepper Resource

Profile: <http://level3.rest/patterns/stepper#stepper-resource>

Contains the value being incremented and decremented. If the value can only be modified by increment or decrement actions, the Stepper resource should be an Info profile. However, if the value can be modified with a PUT request, the Stepper must support the Data profile.

increment

rel="http://level3.rest/patterns/stepper#increment"

Points to an Incrementer resource that increases the value of the Stepper resource by a single step. This relationship only appears if the value can be incremented, meaning the value has no range or it is below its maximum value.

decrement

rel="http://level3.rest/patterns/stepper#decrement"

Points to a Decrementer resource that decreases the value of the Stepper resource by a single step. This relationship only appears if the value can be incremented, meaning it is no range or it is above its minimum value.

Incrementer Resource

Profile: <http://level3.rest/patterns/stepper#incrementer-resource>

An Action resource that increments the value of the Stepper resource by a single step. If the value is already at its maximum, POST to this resource is ignored.

increments

rel="http://level3.rest/patterns/stepper#increments"

Points to the Steper resource that will be incremented.

Decrementer Resource

Profile: <http://level3.rest/patterns/stepper#decrementer-resource>

An Action resource that decrements the value of the Stepper resource by a single step. If the value is already at its minimum, POST to this resource is ignored.

decrements

rel="http://level3.rest/patterns/stepper#decrements"

Points to the Stepper resource that will be decremented.


Copyright © 2019 Matt Bishop
Creative Commons Licence
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.