# Cart

A table with cart item rows.

## Examples

<div class="example">
    <div data-add-to-cart='{"itemId": "1", "styled": false, "text": "Add"}'></div>
</div>

### Enabled cart

```html
<div data-cart></div>
```

<div class="example">
    <div data-cart></div>
</div>

### Disabled cart

The cart can be disabled by passing `enabled: false`.
<br>
This will do the following:

* Add a `disabled` css modifier to the component
* Apply a HTML `disabled`-attribute to `<button>`s, `<inputs>`s and other interactive elements.

```css
/* Example css */

.cart--disabled { opacity: .5 }
input:disabled { background-color: transparent }
button:disabled { display: none }
```

You may want to disable the component on a checkout page after the order has been processed.

```html
<div data-cart='{"enabled": false}'></div>
```

```JavaScript
render('[data-cart]', CartUI, { enabled: false });
```

<div class="example">
    <div data-cart='{"enabled": false}'></div>
</div>
