# @hawk-ui/carousel

> hawk-ui: Basic Carousel Component

Latest version **4.5.3** (published 2025-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hawk-ui/carousel
pnpm add @hawk-ui/carousel
yarn add @hawk-ui/carousel
bun add @hawk-ui/carousel
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.5.3 |
| Published | 2025-09-25 |
| First published | 2020-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 35 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Saurabh Gaur |
| Maintainers | saurabh2112 |
| Keywords | carousel, react, react component, react carousel, hawk, hawk-ui, ui |

## Links

- npm: https://www.npmjs.com/package/@hawk-ui/carousel
- npm.io page: https://npm.io/package/@hawk-ui/carousel

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [classnames](https://npm.io/package/classnames.md) ^2.3.2
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [@hawk-ui/button](https://npm.io/package/@hawk-ui/button.md) ^4.5.3

## Recent versions

- 4.5.3 (latest) — 2025-09-25
- 4.5.2 — 2025-09-25
- 4.5.1 — 2025-07-15
- 4.5.0 — 2025-05-19
- 4.4.9 — 2025-05-19
- 4.4.8 — 2025-04-23
- 4.4.7 — 2025-02-19
- 4.4.6 — 2025-02-11
- 4.4.5 — 2025-02-11
- 4.4.4 — 2024-12-06
- 4.4.3 — 2024-12-05
- 4.4.2 — 2024-11-25
- 4.4.1 — 2024-07-18
- 4.4.0 — 2024-06-24
- 4.3.9 — 2024-06-24
- … 117 more at https://npm.io/package/@hawk-ui/carousel/versions

## README

## Installation


#### To install a component run
`$ npm install @hawk-ui/carousel --save`


#### Please import CSS styles via
```scss noeditor
@import '/path__to__node_modules/@hawk-ui/carousel/dist/index.min.css
```


## Usage


#### Contained carousel:
[Demo](https://hawk.oncrypt.co/#!/Carousel/1)
```js static
import Carousel from '@hawk-ui/carousel';
```
```js
initialState = {
  slides: [
    <div
      style={{
        height: '250px',
        width: '100%',
        flex: '0 0 100%',
        backgroundColor: 'lavender',
      }}
    />,
    <div
      style={{
        height: '250px',
        width: '100%',
        flex: '0 0 100%',
        backgroundColor: 'lavenderblush',
      }}
    />,
    <div
      style={{
        height: '250px',
        width: '100%',
        flex: '0 0 100%',
        backgroundColor: 'lavender',
      }}
    />,
    <div
      style={{
        height: '250px',
        width: '100%',
        flex: '0 0 100%',
        backgroundColor: 'lavenderblush',
      }}
    />,
  ],
};

<Carousel
  id="carousel1"
  slides={state.slides}
  options={{
    display: 1,
    width: 100,
  }}
/>
```


#### Card carousel:
[Demo](https://hawk.oncrypt.co/#!/Carousel/2)
```js static
import Carousel from '@hawk-ui/carousel';
```
```js
initialState = {
  slides: [
    <div
      style={{
        height: '250px',
        width: '400px',
        flex: '0 0 400px',
        backgroundColor: 'lavender',
      }}
    />,
    <div
      style={{
        height: '250px',
        width: '400px',
        flex: '0 0 400px',
        backgroundColor: 'lavenderblush',
      }}
    />,
    <div
      style={{
        height: '250px',
        width: '400px',
        flex: '0 0 400px',
        backgroundColor: 'lavender',
      }}
    />,
    <div
      style={{
        height: '250px',
        width: '400px',
        flex: '0 0 400px',
        backgroundColor: 'lavenderblush',
      }}
    />,
  ],
};

<Carousel
  id="carousel2"
  slides={state.slides}
  variant="card"
  options={{
    display: 2,
    width: 400,
  }}
/>
```


#### Poster carousel:
[Demo](https://hawk.oncrypt.co/#!/Carousel/3)
```js static
import Carousel from '@hawk-ui/carousel';
```
```js
initialState = {
  header: [
    'https://www.w3schools.com/howto/img_nature_wide.jpg',
    'https://www.w3schools.com/howto/img_snow_wide.jpg',
    'https://www.w3schools.com/howto/img_mountains_wide.jpg',
  ],
  slides: [
    <div
      style={{
        height: '250px',
        width: '100%',
        flex: '0 0 100%',
      }}
    >
      <img
        src="https://www.w3schools.com/howto/img_nature_wide.jpg"
        style={{
          height: '100%',
          width: '100%',
          objectFit: 'cover',
        }}
      />
    </div>,
    <div
      style={{
        height: '250px',
        width: '100%',
        flex: '0 0 100%',
      }}
    >
      <img
        src="https://www.w3schools.com/howto/img_snow_wide.jpg"
        style={{
          height: '100%',
          width: '100%',
          objectFit: 'cover',
        }}
      />
    </div>,
    <div
      style={{
        height: '250px',
        width: '100%',
        flex: '0 0 100%',
      }}
    >
      <img
        src="https://www.w3schools.com/howto/img_mountains_wide.jpg"
        style={{
          height: '100%',
          width: '100%',
          objectFit: 'cover',
        }}
      />
    </div>,
  ],
};

<Carousel
  id="carousel3"
  slides={state.slides}
  header={state.header}
  panes={[]}
  variant="poster"
  options={{
    display: 1,
    width: 100,
  }}
/>
```

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