# @times-stories/image-container

> > The background image container template for the `@times-stories` suite of > packages

Latest version **1.2.2** (published 2019-05-07) · 0 weekly downloads

## Install

```sh
npm install @times-stories/image-container
pnpm add @times-stories/image-container
yarn add @times-stories/image-container
bun add @times-stories/image-container
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2019-05-07 |
| First published | 2018-11-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | chrishutchinson, flashcheeks |

## Links

- npm: https://www.npmjs.com/package/@times-stories/image-container
- npm.io page: https://npm.io/package/@times-stories/image-container

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.6.1
- [react-dom](https://npm.io/package/react-dom.md) ^16.6.1
- [@times-stories/style-guide](https://npm.io/package/@times-stories/style-guide.md) ^1.2.2

## Recent versions

- 1.2.2 (latest) — 2019-05-07
- 1.2.1 — 2019-04-04
- 1.1.2 — 2019-03-22
- 1.1.1 — 2019-03-20
- 1.1.0 — 2019-03-20
- 1.0.16 — 2018-12-19
- 1.0.15 — 2018-12-19
- 1.0.14 — 2018-12-19
- 1.0.13 — 2018-12-17
- 1.0.12 — 2018-12-17
- 1.0.11 — 2018-12-17
- 1.0.9 — 2018-11-09
- 1.0.8 — 2018-11-09
- 1.0.7 — 2018-11-09
- 1.0.6 — 2018-11-09
- … 2 more at https://npm.io/package/@times-stories/image-container/versions

## README

# @times-stories/image-container

> The background image container template for the `@times-stories` suite of
> packages

## Installation

```bash
$ yarn add @times-stories/image-container
```

## Usage

This is the base component for many of the `@times-stories` page templates, and
handles image placement / transition logic.

This component provides an interface for placing the focus point of your
background image within a pre-defined safe area. This will work across any
breakpoint, and will work for any image size.

The `backgroundImage` prop should be an object containing your image `src` and a
`focusPoint` object with `x` and `y` percentages, defining where the focus point
of your background image is.

The `centerPoint` props should be an object containing the `x` and `y`
percentages defining where the safe area of your template is. If, for example,
you had text positioned on the left of the template, then you may choose to
define your safe area on the right hand side.

```js
import Story from "@times-stories/story";
import Page from "@times-stories/page";
import ImageContainer from "@times-stories/image-container";

const backgroundImage = {
  src: `url/to/image`,
  focusPoint: {
    x: 30,
    y: 60
  }
};

const centerPoint = {
  x: 20,
  y: 40
};

export default () => (
  <ImageContainer
    backgroundImage={backgroundImage}
    centerPoint={centerPoint}
    withBlur={true}
    withOverlay={true}
    withImpact={false}
  >
    <p>Any JSX here</p>
  </ImageContainer>
);
```

---
_Source: https://npm.io/package/@times-stories/image-container · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
