HammerHammer

Installation

Install the components and tooling packages provided by Hammer.

Last updated:04/10/2026, 05:17:37

Requirements

  • Node.js 20 or newer
  • React 18 or 19

Installing components

Hammer's components are published on npm and can be installed directly with no extra setup.

pnpm add @chaos-design/calendar
npm install @chaos-design/calendar
yarn add @chaos-design/calendar
bun add @chaos-design/calendar

Swap the package name for whichever component you want to install:

Available components

@chaos-design/calendar, @chaos-design/color-picker, @chaos-design/month-datepicker

Installing tooling packages

If you are using this repository's monorepo toolchain:

pnpm add -D @chaos-design/tsconfig
npm install -D @chaos-design/tsconfig
yarn add -D @chaos-design/tsconfig

Importing styles

Styled components need their CSS imported at the entry of your app:

import '@chaos-design/calendar/dist/es/index.css';

Import it in app/layout.tsx:

import '@chaos-design/calendar/dist/es/index.css';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}

Import it in main.tsx:

import '@chaos-design/calendar/dist/es/index.css';

Using a component

Import and render it in your React app:

import '@chaos-design/calendar/dist/es/index.css';
import { Calendar } from '@chaos-design/calendar';

export default function App() {
  return (
    <Calendar
      defaultView="month"
      locale="en"
      events={[
        {
          id: '1',
          title: 'Daily standup',
          start: new Date(2026, 0, 5, 10, 0),
          end: new Date(2026, 0, 5, 10, 30),
        },
      ]}
    />
  );
}

Client components

Calendar, ColorPicker and MonthDatepicker all use React hooks, so they must be rendered on the client. When using them with the Next.js App Router, make sure an ancestor is marked 'use client', or wrap them in your own client component.

On this page