# @salesforce-ux/wes-divider

> A Divider is a single line to separate or group content.

Latest version **0.1.1** (published 2023-09-15) · SEE LICENSE IN README.md license · 0 weekly downloads

## Install

```sh
npm install @salesforce-ux/wes-divider
pnpm add @salesforce-ux/wes-divider
yarn add @salesforce-ux/wes-divider
bun add @salesforce-ux/wes-divider
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-09-15 |
| First published | 2022-07-13 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN README.md |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 310.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Salesforce UX |
| Maintainers | salesforce-ux |

## Links

- npm: https://www.npmjs.com/package/@salesforce-ux/wes-divider
- npm.io page: https://npm.io/package/@salesforce-ux/wes-divider

## Dependencies (3)

- [elix](https://npm.io/package/elix.md) ^15.0.0
- [@salesforce-ux/sds-utils](https://npm.io/package/@salesforce-ux/sds-utils.md) ^0.1.1
- [@salesforce-ux/sds-common](https://npm.io/package/@salesforce-ux/sds-common.md) ^0.1.3

## Recent versions

- 0.1.1 (latest) — 2023-09-15
- 0.1.0 — 2022-07-13

## README

# `@salesforce-ux/wes-divider`
[![npm (custom registry)](https://img.shields.io/npm/v/@salesforce-ux/wes-divider/latest?color=green&label=npm%20package)](https://www.npmjs.com/package/@salesforce-ux/wes-divider)

## About

Dividers are used to represent thematic breaks between paragraph-level elements. Dividers helps categorize and organize the content in a page

## Getting Started

Let's start by installing wes-divider as a dependency of your project with [npm](https://www.npmjs.com/package/@salesforce-ux/wes-divider).

```
npm i @salesforce-ux/wes-divider
```
## Distributable
After installation, all the distributables for the `wes-divider` are found under `@salesforce-ux/wes-divider/dist/` folder.

|File Name |Description |
|- |- |
|`divider.css` |The CSS file for `wes-divider` component.|
|`divider.js` |The bundled JS file for `wes-divider` component.This file is useful for **Non LWC** applications.([see below](#for-non-lwc-application) &rarr;)|


## `wes-divider` Integration

For the sake of understanding, we have categorized the development environment into LWC and Non LWC application. If you are using the Salesforce Experience Cloud platform, WES is supported through an Unlocked Package, see the [Confluence page for the WES Unlocked Package](https://confluence.internal.salesforce.com/display/CSGT4GG/Website+Experience+Subsystem+%28WES%29+Unlocked+Package).
 
This Guide covers the integration approach for these two types of application.

### For `Lightning Web Component(LWC)` Application

> #### Dependency Inclusion

[`wes-styling-hooks`](https://www.npmjs.com/package/@salesforce-ux/wes-styling-hooks) is a styling dependency for `wes-divider`. Hence, this needs to be embedded into the root of the web app in order to make the `wes-divider` render properly.

```html
<html>
  <head>
    <link rel="stylesheet" href="/node_modules/@salesforce-ux/wes-styling-hooks/dist/hooks.custom-props.css">
    <!-- Your application's other stylesheets go below -->
    <link rel="stylesheet" href="...">
  </head>
  <body>
    <!-- Your application -->
  </body>
</html>
```

There are also other ways [`wes-styling-hooks`](https://www.npmjs.com/package/@salesforce-ux/wes-styling-hooks) can be embedded. Please checkout the [`wes-styling-hooks` Integration Guide](https://www.npmjs.com/package/@salesforce-ux/wes-styling-hooks) to learn more.


> #### Component CSS Import
```css
/* myComponent.css */
@import "@salesforce-ux/wes-divider/dist/divider.css";
```

> #### HTML Decoration
After that,the HTML of your LWC component template needs to be decorated to have all the named part attributes as per the [component's specification](./divider.spec.md).
Below is a reference to the component's structure.
```html
<div part="divider">
  <div part="content">
    <slot name="icon"></slot>
    <span part="label">
      <slot></slot>
    </span>
  </div>
</div>
```

### For `Non LWC` Application

> #### Dependency Inclusion [Read the section above](#dependency-inclusion)

> #### Component Import

```js
/* myComponent.js */
import WESDivider from "@salesforce-ux/wes-divider/dist/divider";
```

> #### Component Registration

```js
/* myComponent.js */
customElements.define('wes-divider', WESDivider);
```

#### Example

Below is one approach to integrate your `wes-divider` component.
##### Script
```js
/* myComponent.js */
import "@salesforce-ux/wes-styling-hooks/dist/hooks.custom-props.css";
import WESDivider from "@salesforce-ux/wes-divider/dist/divider";
window.customElements.define('wes-divider', WESDivider);

```

##### HTML
```html
<wes-divider variant="primary" direction="horizontal" color="red"></wes-divider>
```

## Interactive Demo
To see more examples with interactive demo, please visit `wes Subsytem`'s [Storybook Environment](https://wes-subsystem-storybook.herokuapp.com/?path=/story/wes-subsystem-components-divider--default)

---
_Source: https://npm.io/package/@salesforce-ux/wes-divider · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
