# @cleartrip/ct-design-button

> A button component is a reusable user interface element used in web development to create interactive elements that users can click or tap to perform actions.

Latest version **5.32.0** (published 2026-11-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install @cleartrip/ct-design-button
pnpm add @cleartrip/ct-design-button
yarn add @cleartrip/ct-design-button
bun add @cleartrip/ct-design-button
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.32.0 |
| Published | 2026-11-16 |
| First published | 2023-10-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 170.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kanishk Gupta |
| Maintainers | rahulct_com, supragya.chauhan, nareshkapse_ct, saranshdawra, ct_devops, sidhantrajan, hello_world_arya, ritesh.kumarjena, mohitjaincleartrip, ashwin.ct, ashokmpatel, amansaxena1, aakrishtmalik, prateek.oraon, ashwin-ui-ct, shashi-kumar |

## Links

- npm: https://www.npmjs.com/package/@cleartrip/ct-design-button
- npm.io page: https://npm.io/package/@cleartrip/ct-design-button

## Dependencies (10)

- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.14.0
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.14.0
- [@cleartrip/ct-design-theme](https://npm.io/package/@cleartrip/ct-design-theme.md) 5.32.0
- [@cleartrip/ct-design-types](https://npm.io/package/@cleartrip/ct-design-types.md) 5.32.0
- [@cleartrip/ct-design-container](https://npm.io/package/@cleartrip/ct-design-container.md) 5.32.0
- [@cleartrip/ct-design-typography](https://npm.io/package/@cleartrip/ct-design-typography.md) 5.32.0
- [@cleartrip/ct-design-dotted-loader](https://npm.io/package/@cleartrip/ct-design-dotted-loader.md) 5.32.0
- [@cleartrip/ct-design-style-manager](https://npm.io/package/@cleartrip/ct-design-style-manager.md) 5.32.0
- [@cleartrip/ct-design-conditional-wrap](https://npm.io/package/@cleartrip/ct-design-conditional-wrap.md) 5.32.0
- [@cleartrip/ct-design-event-propagation](https://npm.io/package/@cleartrip/ct-design-event-propagation.md) 5.32.0

## Recent versions

- 5.32.0 (latest) — 2026-11-16
- 5.33.0-SNAPSHOT-hdp-revamp-v1.0 (SNAPSHOT-hdp-revamp-v1) — 2026-11-19
- 3.33.0-SNAPSHOT-vt-2.0 (SNAPSHOT-vt-2) — 2026-11-18
- 3.33.0-SNAPSHOT-vt-1.0 (SNAPSHOT-vt-1) — 2026-11-18
- 5.32.0-SNAPSHOT-bs-height-check-161120162106.0 (SNAPSHOT-bs-height-check-161120162106) — 2026-11-16
- 5.32.0-SNAPSHOT-bs-height-check-161120162007.0 (SNAPSHOT-bs-height-check-161120162007) — 2026-11-16
- 5.32.0-SNAPSHOT-5.32.0-SNAPSHOT-bs-height-check-161120161537.0 (SNAPSHOT-5.32.0-SNAPSHOT-bs-height-check-161120161537) — 2026-11-16
- 5.32.0-SNAPSHOT-bs-height-check-151120162243.0 (SNAPSHOT-bs-height-check-151120162243) — 2026-11-15
- 3.33.0-SNAPSHOT-hdp-revamp-v3.0 (SNAPSHOT-hdp-revamp-v3) — 2026-11-12
- 3.33.0-SNAPSHOT-hdp-revamp-v2.0 (SNAPSHOT-hdp-revamp-v2) — 2026-11-12
- 5.32.0-SNAPSHOT-biztrip-rn-sme-snapshot-11-11-26.0 (SNAPSHOT-biztrip-rn-sme-snapshot-11-11-26) — 2026-11-11
- 5.32.0-SNAPSHOT-native-main.2 (SNAPSHOT-native-main) — 2026-11-11
- 5.32.0-SNAPSHOT-fix-intersection-observer-v2.0 (SNAPSHOT-fix-intersection-observer-v2) — 2026-11-02
- 5.32.0-SNAPSHOT-fix-intersection-observer-v1.0 (SNAPSHOT-fix-intersection-observer-v1) — 2026-11-02
- 5.32.0-SNAPSHOT-srp-similar-hotels-v2.0 (SNAPSHOT-srp-similar-hotels-v2) — 2026-10-29
- … 1045 more at https://npm.io/package/@cleartrip/ct-design-button/versions

## README

# Button

A button component is a reusable user interface element used in web development to create interactive elements that users can click or tap to perform actions.

---

## Installation

```bash
npm install @cleartrip/ct-design-button
# or
pnpm add @cleartrip/ct-design-button
```

### Peer dependencies

```bash
# Required for all targets
npm install react

# Web only
npm install react-dom

# React Native only
npm install react-native
```

---

## Usage

### Basic

```tsx
import { Button, ButtonVariant, ButtonColor, ButtonSize } from '@cleartrip/ct-design-button';

function Example() {
  return <Button onClick={() => console.log('clicked')}>Click me</Button>;
}
```

### With variants

```tsx
<Button variant={ButtonVariant.CONTAINED} color={ButtonColor.PRIMARY}>
  Contained Button
</Button>

<Button variant={ButtonVariant.OUTLINE} color={ButtonColor.SECONDARY}>
  Outline Button
</Button>

<Button variant={ButtonVariant.BARE}>
  Bare Button
</Button>
```

### With sizes

```tsx
<Button size={ButtonSize.SMALL}>Small Button</Button>
<Button size={ButtonSize.MEDIUM}>Medium Button</Button>
<Button size={ButtonSize.LARGE}>Large Button</Button>
```

### With icons

```tsx
<Button
  showLeftIcon={true}
  LeftIcon={<MyIcon />}
>
  Button with left icon
</Button>

<Button
  showRightIcon={true}
  RightIcon={<MyIcon />}
>
  Button with right icon
</Button>
```

### Loading state

```tsx
<Button loading={isLoading}>{isLoading ? 'Loading...' : 'Submit'}</Button>
```

---

## Props

| Prop            | Type            | Default     | Required | Description                     |
| --------------- | --------------- | ----------- | -------- | ------------------------------- |
| `children`      | `ReactNode`     | —           | Yes      | Button content                  |
| `onClick`       | `() => void`    | —           | No       | Click handler function          |
| `variant`       | `ButtonVariant` | `CONTAINED` | No       | Visual style of the button      |
| `size`          | `ButtonSize`    | `MEDIUM`    | No       | Size of the button              |
| `color`         | `ButtonColor`   | `PRIMARY`   | No       | Color scheme of the button      |
| `disabled`      | `boolean`       | `false`     | No       | Whether the button is disabled  |
| `loading`       | `boolean`       | `false`     | No       | Whether to show loading state   |
| `isFullWidth`   | `boolean`       | `false`     | No       | Whether button takes full width |
| `minWidth`      | `string`        | `50px`      | No       | Minimum width of the button     |
| `showLeftIcon`  | `boolean`       | `false`     | No       | Whether to show left icon       |
| `LeftIcon`      | `ReactElement`  | —           | No       | Left icon element               |
| `showRightIcon` | `boolean`       | `false`     | No       | Whether to show right icon      |
| `RightIcon`     | `ReactElement`  | —           | No       | Right icon element              |

---

## Variants

- `CONTAINED` — Filled button with background color
- `OUTLINE` — Button with border, no background
- `BARE` — Text-only button, no background or border

## Sizes

- `SMALL` — Compact button for tight spaces
- `MEDIUM` — Standard button size (default)
- `LARGE` — Larger button for emphasis

## Colors

- `PRIMARY` — Main brand color
- `SECONDARY` — Secondary color scheme
- `TERTIARY` — Tertiary color scheme
- `NEUTRAL` — Neutral/gray color scheme
- `SUCCESS` — Green, for confirming/approving actions
- `DANGER` — Red, for destructive/rejecting actions

---

## Accessibility

- Buttons include proper ARIA attributes
- Disabled buttons are not focusable
- Loading buttons announce state to screen readers
- Ensure sufficient color contrast for all variants
- Icons should have appropriate alt text or ARIA labels

---

## Migration

If migrating from previous versions:

```diff
- import { Button } from 'yagami/core/components';
+ import { Button, ButtonVariant, ButtonColor, ButtonSize } from '@cleartrip/ct-design-button';
```

---
_Source: https://npm.io/package/@cleartrip/ct-design-button · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
