Components · Hold
Card <clay-card>
A clay slab that holds content. Flatter than a button, with a deeper shadow. interactive makes it swell.
Songs played
1,248
Current streak
7
<div class="demo-row">
<clay-card color="mint" class="demo-card">
<clay-badge color="neutral">+16%</clay-badge>
<h3>Songs played</h3>
<p class="demo-stat">1,248</p>
</clay-card>
<clay-card color="lilac" elevation="3" class="demo-card">
<clay-badge color="neutral">7 days</clay-badge>
<h3>Current streak</h3>
<p class="demo-stat">7</p>
</clay-card>
</div>
<div class="demo-row">
<clay-card color="mint" class="demo-card">
<clay-badge color="neutral">+16%</clay-badge>
<h3>Songs played</h3>
<p class="demo-stat">1,248</p>
</clay-card>
<clay-card color="lilac" elevation="3" class="demo-card">
<clay-badge color="neutral">7 days</clay-badge>
<h3>Current streak</h3>
<p class="demo-stat">7</p>
</clay-card>
</div>
Use it for
- Grouping related content: a stat, a summary, a settings group.
Not for
- The whole card as one action: put a Press inside, or use
interactivewith a link inside.
Installation
npm install claymorph-ui @ui-sdk/web @ui-sdk/core
npm install claymorph-ui @ui-sdk/web @ui-sdk/core
Then import claymorph-ui/clay.css once and each element you use, like claymorph-ui/button.
Usage
<clay-card color="mint" elevation="2">
<h3>Songs played</h3>
<p>1,248</p>
</clay-card>
<clay-card color="mint" elevation="2">
<h3>Songs played</h3>
<p>1,248</p>
</clay-card>
API reference
Attributes
| Name | Type | Default |
|---|---|---|
colorThe clay's colour: a preset, or any CSS colour. It sets |
neutral | teal | lilac | sky | peach | mint | butter | rose | slate | ink | <color> |
— |
elevationHow far it floats: the shadow's size and offset. |
1 | 2 | 3 |
2 |
radiusCorner radius of the clay. |
number (px) |
28 |
interactiveSwells and squashes like a button. Read once, when it connects. |
boolean |
— |
Accessibility
- A plain container: give it a heading, and put real controls inside for actions.