React Position Helper

Position

Use these helpers for quickly configuring the position of an element.

Fixed top

Position an element at the top of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in your project; you may need to add additional CSS.

<div className="fixed-top">...</div>

Fixed bottom

Position an element at the bottom of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in your project; you may need to add additional CSS.

<div className="fixed-bottom">...</div>

Sticky top

Position an element at the top of the viewport, from edge to edge, but only after you scroll past it.

<div className="sticky-top">...</div>

Responsive sticky top

Responsive variations also exist for .sticky-top utility.

<div className="sticky-sm-top">Stick to the top on viewports sized SM (small) or wider</div>
<div className="sticky-md-top">Stick to the top on viewports sized MD (medium) or wider</div>
<div className="sticky-lg-top">Stick to the top on viewports sized LG (large) or wider</div>
<div className="sticky-xl-top">Stick to the top on viewports sized XL (extra-large) or wider</div>
<div className="sticky-2xl-top">Stick to the top on viewports sized XXL (extra-extra-large) or wider</div>

Sticky bottom

Position an element at the bottom of the viewport, from edge to edge, but only after you scroll past it.

<div className="sticky-bottom">...</div>

Responsive sticky bottom

Responsive variations also exist for .sticky-bottom utility.

<div className="sticky-sm-bottom">Stick to the bottom on viewports sized SM (small) or wider</div>
<div className="sticky-md-bottom">Stick to the bottom on viewports sized MD (medium) or wider</div>
<div className="sticky-lg-bottom">Stick to the bottom on viewports sized LG (large) or wider</div>
<div className="sticky-xl-bottom">Stick to the bottom on viewports sized XL (extra-large) or wider</div>
<div className="sticky-2xl-bottom">Stick to the bottom on viewports sized XXL (extra-extra-large) or wider</div>