# Cloud Shapes

Paper-white decorative shapes lit with a two-color crescent shadow, in fourteen geometries from circle and pill to egg, arch and shield. Pinned to a daylight look; the shading deepens on dark grounds.

Component · Graphics · https://01orbital.dev/docs/components/cloud-shapes

## Installation

```bash
npx shadcn@latest add @01orbital/cloud-shapes
```

## Usage

```tsx
import {
  CloudShape,
  type CloudShapeName,
} from "@/components/graphics/cloud-shapes"

const SHAPES: CloudShapeName[] = [
  "circle",
  "pill",
  "vpill",
  "square",
  "squircle",
  "chip",
  "rect",
  "blob",
  "egg",
  "pebble",
  "semicircle",
  "arch",
  "lozenge",
  "shield",
]
const TONES = ["rose", "coral", "teal", "purple", "gold"] as const

export default function CloudShapesDemo() {
  return (
    <div className="flex w-full flex-wrap place-items-center justify-center gap-x-10 gap-y-8 p-6">
      {SHAPES.map((shape, i) => (
        <CloudShape
          key={shape}
          shape={shape}
          palette={PALETTES[TONES[i % TONES.length]]}
        />
      ))}
    </div>
  )
}

const PALETTES = {
  rose: {
    main: "oklch(0.638 0.107 20.5)",
    accent: "oklch(0.616 0.057 195.8)",
  },
  coral: {
    main: "oklch(0.582 0.122 31.3)",
    accent: "oklch(0.638 0.107 20.5)",
  },
  teal: {
    main: "oklch(0.616 0.057 195.8)",
    accent: "oklch(0.582 0.122 31.3)",
  },
  purple: {
    main: "oklch(0.581 0.057 319.9)",
    accent: "oklch(0.638 0.107 20.5)",
  },
  gold: {
    main: "oklch(0.69 0.097 88.5)",
    accent: "oklch(0.616 0.057 195.8)",
  },
} as const
```

This example installs with everything it uses:

```bash
npx shadcn@latest add @01orbital/cloud-shapes-demo
```

## API reference

A paper-white shape lit from the upper left, with a tinted crescent of shade, used as decoration or as a stand-in avatar. The paper stays light in every theme; in dark mode the shading is stronger so it does not read as flat white.

Hidden from assistive tech, so any `children` (an initial, an icon) are hidden with it; give decorative content only. Children are centered inside the shape in dark ink (paper stays light in every theme; set a text color with `className` to change it), and nothing changes without them. Shading strength is the `--cloud-depth` variable (1 in light, 2.5 in dark), which you can override through `style`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children?` | `ReactNode` |  | Content centered inside the shape, above its shading, such as an initial or a small icon. It is hidden from assistive tech with the shape. |
| `shape?` | `"circle" \| "rect" \| "square" \| "pill" \| "vpill" \| "squircle" \| "chip" \| "blob" \| "egg" \| "pebble" \| "semicircle" \| "arch" \| "lozenge" \| "shield"` | `"circle"` | One of 14 outlines, such as `circle`, `pill`, `squircle`, `egg` or `arch`. Each has its own designed size in px. |
| `palette?` | `CloudPalette` | `DEFAULT_PALETTE` | Shading tints: `main` for the crescent and drop shadow, `accent` for a fainter second tint. |
| `scale?` | `number` | `1` | Multiplies the shape's designed size; 1 is the size it was designed at. |
| `width?` | `number` |  | Width in px. Replaces the shape's width times `scale`. |
| `height?` | `number` |  | Height in px. Replaces the shape's height times `scale`. |

## Dependencies

npm: `cn`

## Examples

- **Cloud Shapes Class Selector** (`@01orbital/cloud-shapes-class-selector`): Studio class announcement example built on Cloud Shapes: a caps eyebrow, a heading and a radio choice-card picker for two classes, each led by a shape in its own palette, on sand paper grain. A sign-up or workshop announcement for a site.
- **Cloud Shapes Magazine Cover** (`@01orbital/cloud-shapes-magazine-cover`): Cloud Shapes Magazine Cover: an example of cloud-shapes.
- **Cloud Shapes Team Avatars** (`@01orbital/cloud-shapes-team-avatars`): Cloud Shapes Team Avatars: an example of cloud-shapes.
- **Cloud Shapes Paper Objects** (`@01orbital/cloud-shapes-paper-objects`): Material study example built on Cloud Shapes for a site hero or feature band: warm paper objects with coral, teal and ochre crescent shadows on paper grain, under a caps eyebrow and a short headline.

## Used in blocks

- [Contact List](https://01orbital.dev/docs/blocks/contact-list)
- [Contact List Card](https://01orbital.dev/docs/blocks/contact-list-card)
- [Glow Rig Testimonial with Logo](https://01orbital.dev/docs/blocks/single-testimonial-02)
- [Masonry Testimonial Wall](https://01orbital.dev/docs/blocks/testimonial-wall-01)
- [Paired Testimonials](https://01orbital.dev/docs/blocks/testimonial-pair-01)
- [Testimonial Card Grid](https://01orbital.dev/docs/blocks/testimonial-grid-01)
