---
name: Swatch
menu: Components
route: /components/swatch
---

import { Playground, Props } from 'docz'
import Swatch from '../swatch'

# Swatch

### Basic swatch

<Playground>
    <Swatch color="orange" />
</Playground>

### Swatch with different shapes and sizes

<Playground>
    <Swatch color="red" size="2em" />
    <Swatch color="yellow" size="3em" circle />
    <Swatch color="green" size="4em" rounded />
</Playground>


## PropTypes

| Prop | Type | Required | Default | Description |
|:-----|:-----|:---------|:--------|:------------|
| color | string | yes | | should be a key in theme colors |
| rounded | bool | no | false | |
| circle | bool | no | false | overrides rounded |
| `COMMON` | Style Prop |  |  | see [Style Props](/style-props) |
| `BORDER` | Style Prop |  |  | see [Style Props](/style-props) |
| `LAYOUT` | Style Prop |  |  | see [Style Props](/style-props) |
| `POSITION` | Style Prop |  |  | see [Style Props](/style-props) |
| `FLEX_ITEM` | Style Prop |  |  | see [Style Props](/style-props) |
| `MISC` | Style Prop |  |  | see [Style Props](/style-props) |


## Theming

### Schema
```
{
  space: {
    p
  },
  sizes: {
    size
  },
  radii: {
    rounded
  },
  overrides: css`
    ...
  `
}
```

- [Default theme](https://github.com/raster-foundry/blasterjs/tree/master/packages/core/theme/components/swatch)
- [Learn more about themeing](/blaster-theme)
