Depending on the structure of your stairs there are two.
Encapping the side of carpet stairs.
Choosing carpet for the stairs can be a bit more difficult than choosing carpet for other areas of the home.
Stairs are the most common place in the home to have carpet and yet they are also the trickiest.
You will need approximately 4 of carpet to cover the width to allow the carpet to flow through the posts and wrap around the outside of the stair.
A stair that has one open side with railing posts on it is known as a cap stair.
How to finish the side of a carpet on stairs.
A stair stringer also called string or stringer board is the housing on either side of a flight of stairs into which the treads and risers are fixed.
It has the same measurements for the tread and riser as a box stair combined 18.