> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: CloseButton Component

## Article: CloseButton Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/actions/close-button-component.md

## Article Content:

# CloseButton

_Components/Actions_

Interactive docs page: <https://wix-pages.com/design-system-documentation/#/component/closebutton>

## Overview

```jsx
<Box align="center">
  <CloseButton skin="dark" size="large" />
</Box>;
```

Close button is an interactive element that allows users to exit an event.

### Do

- Use it to close pages, notifications, helpers, cards or menus.
- Use one close button at a time.

### Don't

- Don't use it to trigger any action other than close. Use `<Button/>` or `<IconButton/>` instead.

### Feature examples

#### Size

Use `size` prop to choose the size of the close button:

- Use `large` in larger size layouts, such as `<SidePanel/>` or modals.
- Use `medium` in medium size layouts, such as `<FloatingNotification/>`.
- Use `small` (default) for common use cases.

```jsx
<StorybookComponents.Stack>
  <CloseButton size="large" />
  <CloseButton size="medium" />
  <CloseButton />
</StorybookComponents.Stack>;
```

#### Skin

Use `skin` prop to control the appearance of the close button.

- Use `standard` on white backgrounds.
- Use `standardFilled` on white backgrounds when action needs to be emphasised.
- Use `transparent` on colour or image backgrounds.
- Use `light` on dark backgrounds.
- Use `dark` on white or light color backgrounds.

```jsx
<StorybookComponents.Stack>
  <Box align="center" padding="8px" backgroundColor="D80">
    <CloseButton skin="standard" />
  </Box>
  <Box align="center" padding="8px" backgroundColor="D80">
    <CloseButton skin="standardFilled" />
  </Box>
  <Box align="center" padding="8px" backgroundColor="B20">
    <CloseButton skin="transparent" />
  </Box>
  <Box align="center" padding="8px" backgroundColor="D10">
    <CloseButton skin="light" />
  </Box>
  <Box align="center" padding="8px" backgroundColor="D80">
    <CloseButton skin="dark" />
  </Box>
</StorybookComponents.Stack>;
```

#### Disabled

Use `disabled` prop to disable all close button interactions and to highlight unavailable functions.

```jsx
<CloseButton disabled />;
```

### Developer examples

#### Custom HTML tag

Use `as` prop to render close button as any given HTML tag.

For example, they can be rendered as:

- `<a>` when attributes like href, target, etc., are needed.
- `<Link> `when props like to, replace, etc. are needed.

All attributes will be passed to the rendered HTML tag.

```jsx
() => {
  const ReactRouterLink = (props) => <div {...props} />;
  return (
    <StorybookComponents.Stack gap="60px">
      <Box direction="vertical">
        <CloseButton
          as="a"
          href="https://www.wix.com"
          target="_blank"
          size="large"
        />
        <Text size="small">An &lt;a/&gt; tag</Text>
      </Box>
      <Box direction="vertical">
        <CloseButton
          as={ReactRouterLink}
          href="https://www.wix.com"
          target="_blank"
          size="large"
        />
        <Text size="small">A react router &lt;Link/&gt; tag</Text>
      </Box>
      <Box direction="vertical">
        <CloseButton
          as="button"
          href="https://www.wix.com"
          target="_blank"
          size="large"
        />
        <Text size="small">A native &lt;button/&gt; tag</Text>
      </Box>
    </StorybookComponents.Stack>
  );
};
```

### Common use case examples

#### Marketing card

Allow users to dismiss a promotional marketing card by passing a close button as `<Card/>` controls.

```jsx
<Card controls={<CloseButton skin="dark" />}>
  <MarketingLayout
    title="Add sessions to get booked"
    description="Set when this service is offered and which staff member will provide it."
    actions={
      <Box gap="6px">
        <Button size="small">Add Sessions</Button>
        <Button size="small" skin="inverted">
          Learn More
        </Button>
      </Box>
    }
    size="small"
    image={
      <Box width="100%" align="right">
        <Image width="120px" src="PromotionalBookingsUpgrade.svg" transparent />
      </Box>
    }
  />
</Card>;
```

#### Custom icon

To add a help icon next to the close button, pass the help icon as a child element to `<CloseButton/>`.

This is valid only when the help icon is next to the close button. For all other cases use `<IconButton/>` instead.

While it is possible to override the `x` icon with any other icon, it is not recommended to ensure the component's consistency.

```jsx
<Card
  controls={
    <Box>
      <CloseButton skin="dark" size="medium">
        <Icons.HelpSmall />
      </CloseButton>
      <CloseButton skin="dark" size="medium" />
    </Box>
  }
>
  <Card.Content>
    <Box height="90px" />
  </Card.Content>
</Card>;
```

## Code

```jsx
import { CloseButton } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `as` | `"button"` | — | Renders component as any other component or a given HTML tag. |
| `autoFocus` | `boolean` | — | Focus the button on mount. |
| `children` | `ReactNode` | — | Used for passing any |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute that can be used in the tests. |
| `disabled` | `boolean` | `false` | Specifies whether user interactions are disabled. |
| `onClick` | `MouseEventHandler` | — | Defines a callback function which is called every time a button is clicked. |
| `ref` | `null \| string \| (instance: HTMLButtonElement \| null) => void \| RefObject<HTMLButtonElement>` | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
| `size` | `"small" \| "medium" \| "large"` | `'small'` | Controls the size of the button and its icon. |
| `skin` | `"standard" \| "light" \| "dark" \| "transparent" \| "standardFilled" \| "lightFilled"` | `'standard'` | Controls the skin of the button. |

## Testkit

Import the driver matching your test environment:

```jsx
// UniDriver
import { CloseButtonUniDriver } from '@wix/design-system/dist/testkit/unidriver';

// Vanilla
import { CloseButtonTestkit } from '@wix/design-system/dist/testkit';

// Puppeteer
import { CloseButtonTestkit } from '@wix/design-system/dist/testkit/puppeteer';

// Testing Library
import { CloseButtonTestkit } from '@wix/design-system/dist/testkit/testing-library';
```

### Driver methods

| Method | Description |
| --- | --- |
| `isButtonDisabled` | Checks whether the button is disabled |
| `getAriaLabel` | Returns the aria-label attribute of the button |
| `exists` | Checks whether the component found with the given data hook. |
| `element` | Gets the component root element. |
| `click` | Clicks on the component root element. |
| `base` | Returns UniDriver for the base element. |

## Changelog

- **1.340.0** (2026-10-21) — maintenance release, no component-specific changes
- **1.339.0** (2026-10-19) — maintenance release, no component-specific changes
- **1.338.0** (2026-10-15) — maintenance release, no component-specific changes
- **1.331.0** (2026-10-01) — maintenance release, no component-specific changes
- **1.330.0** (2026-09-28) — maintenance release, no component-specific changes
- **1.325.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.323.0** (2026-09-10) — maintenance release, no component-specific changes
- **1.315.0** (2026-08-20) — feat: supported by `WixDesignSystemDefaultPropsProvider`, so its props can be defaulted from the provider. ([#16812](invalid-url))
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.273.0** (2026-04-30) — maintenance release, no component-specific changes
- **1.266.0** (2026-04-07) — maintenance release, no component-specific changes
- **1.260.0** (2026-03-17) — maintenance release, no component-specific changes
- **1.254.0** (2026-02-03) — maintenance release, no component-specific changes
- **1.247.2** (2026-01-21) — maintenance release, no component-specific changes
- **1.244.0** (2026-01-02) — maintenance release, no component-specific changes
- **1.242.0** (2025-12-19) — maintenance release, no component-specific changes
- **1.235.0** (2025-12-04) — maintenance release, no component-specific changes
- **1.233.0** (2025-12-02) — maintenance release, no component-specific changes
- **1.212.0** (2025-08-11) — maintenance release, no component-specific changes
- **1.208.0** (2025-07-25) — breaking: editor3 tokenization + fixes according to Figma ([#15114](invalid-url))
- **1.180.0** (2025-04-14) — feat: change studio tokens colors for CloseButton ([#14739](invalid-url))
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.131.0** (2024-10-10) — maintenance release, no component-specific changes
- **1.126.0** (2024-09-09) — maintenance release, no component-specific changes
- **1.115.0** (2024-07-17) — maintenance release, no component-specific changes
- **1.107.0** (2024-05-29) — maintenance release, no component-specific changes
- **1.104.1** (2024-05-14) — maintenance release, no component-specific changes
- **1.102.0** (2024-04-16) — maintenance release, no component-specific changes
- **1.93.0** (2024-02-08) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes