# @lcap-ui/elevation

> LCAP Elevation component

Latest version **0.0.10** (published 2021-01-28) · 0 weekly downloads

## Install

```sh
npm install @lcap-ui/elevation
pnpm add @lcap-ui/elevation
yarn add @lcap-ui/elevation
bun add @lcap-ui/elevation
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2021-01-28 |
| First published | 2021-01-23 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | whalecloud-developer |

## Links

- npm: https://www.npmjs.com/package/@lcap-ui/elevation
- npm.io page: https://npm.io/package/@lcap-ui/elevation

## Dependencies (3)

- [@lcap-ui/base](https://npm.io/package/@lcap-ui/base.md) ^0.0.10
- [@lcap-ui/types](https://npm.io/package/@lcap-ui/types.md) ^0.0.10
- [@material/elevation](https://npm.io/package/@material/elevation.md) ^5.1.0

## Recent versions

- 0.0.10 (latest) — 2021-01-28
- 0.0.8 — 2021-01-28
- 0.0.7 — 2021-01-23

## README

# Elevation

Elevation is the relative distance between two surfaces along the z-axis.

- Module **@lcap-ui/elevation**
- Import styles:
  - Using CSS Loader
    - import '@lcap-ui/elevation/styles';
  - Or include stylesheets
    - **'@material/elevation/dist/mdc.elevation.css'**
- MDC Docs: [https://material.io/develop/web/components/elevation/](https://material.io/develop/web/components/elevation/)

```jsx
<>
  {Array(25)
    .fill(undefined)
    .map((val, i) => (
      <Elevation z={i} key={i}>
        {i}dp
      </Elevation>
    ))}
</>
```

```jsx
function Example() {
  const [elevation, setElevation] = React.useState(0);

  return (
    <Elevation
      z={elevation}
      transition
      onMouseOver={() => setElevation(24)}
      onMouseOut={() => setElevation(0)}
    >
      Hover Me {elevation}dp
    </Elevation>
  );
}
```

## Wrapping Children

You can avoid adding extra DOM nodes by using the `wrap` prop on elevation. This will apply the classes directly to the child component. Additionally, Elevation is simply a `className`, so you can achieve the same effect by adding `className="mdc-elevation--z15"`.

```jsx
<Elevation z={21} wrap>
  <span>Wrapped!</span>
</Elevation>
```

## Elevation

The Elevation Component

### Props

| Name | Type | Description |
|------|------|-------------|
| `transition` | `undefined \| false \| true` | Allows for smooth transitions between elevations when the z value changes. |
| `wrap` | `undefined \| false \| true` | Allows the elevation classes to be merged onto the child component instead of creating an new DOM node. |
| `z` | `number \| string` | A number from 0 - 24 for different levels of elevation |

---
_Source: https://npm.io/package/@lcap-ui/elevation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
