## Feature Examples

### Size
- description: 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.
- example:
```jsx
<StorybookComponents.Stack>
  <CloseButton size="large" />
  <CloseButton size="medium" />
  <CloseButton />
</StorybookComponents.Stack>;
```

### Skin
- description: 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.
- example:
```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
- description: Use `disabled` prop to disable all close button interactions and to highlight unavailable functions.
- example:
```jsx
<CloseButton disabled />;
```

## Developer Examples

### Custom HTML tag
- description: 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.
- example:
```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
- description: Allow users to dismiss a promotional marketing card by passing a close button as `<Card/>` controls.
- example:
```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
- description: 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.
- example:
```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>;
```
