Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
CartSidebar

Displays the summary of items added to the cart along with detailed information, and checkout option.

The CartSidebar displays the summary of items added to the cart along with detailed information, and checkout option.The final component is a compound of the following:
  • CartSidebar: renders a SlideOver as wrapper with the CartSidebarList and CartSidebarFooter.
  • CartSidebarList: wraps a series of CartItems and Gifts.
  • CartSidebarFooter: wraps an OrdeSummary usually along with the Checkout Button.
Example
Code

Usage

Import the component


_10
import { CartSidebar, CartSidebarList, CartSidebarFooter } from "@faststore/ui";

Import styles

To apply styles, include the following in your stylesheet:

_10
@import "@faststore/ui/src/components/organisms/CartSidebar/styles.scss";


Design tokens

Local tokenDefault value/Global token linked
--fs-cart-sidebar-bkg-color
var(--fs-color-neutral-bkg)

Nested Elements

List

Local tokenDefault value/Global token linked
--fs-cart-sidebar-list-paddingvar(--fs-spacing-3)

Footer

Local tokenDefault value/Global token linked
--fs-cart-sidebar-footer-bkg-color
var(--fs-color-neutral-0)
--fs-cart-sidebar-footer-box-shadow0 0 6px rgb(0 0 0 / 20%)

Data attributes

You can target and override CartSidebar styles using the following data attributes: data-fs-cart-sidebar
data-fs-cart-sidebar-title
data-fs-cart-sidebar-list
data-fs-cart-sidebar-footer

Props

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: cypress, testing-library, and jest).fs-cart-sidebar
titlestringTitle for the CartSidebar component.Your Cart
direction"leftSide" | "rightSide"Represents the side that the CartSidebar comes from.rightSide
size"full" | "partial"Represents the size of the CartSidebar.partial
totalItems*numberTotal of item in the Cart.
alertIconstring | number | false | true | {} | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortalA React component that will be rendered as an icon on the Alert component.
alertTextstringThe content for Alert component.
overlayPropsPropsProps forwarded to the `Overlay` component.
onClose*() => voidFunction called when Close Button is clicked.

Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
On this page