MCPcopy Create free account
hub / github.com/adobe/react-spectrum / ColorSwatch

Function ColorSwatch

packages/dev/s2-docs/src/IconColors.tsx:6–59  ·  view source on GitHub ↗
({name})

Source from the content-addressed store, hash-verified

4import {style} from '@react-spectrum/s2/style' with {type: 'macro'};
5
6function ColorSwatch({name}) {
7 return (
8 <div
9 className={style({
10 display: 'flex',
11 gap: 8,
12 marginBottom: 4,
13 font: 'ui',
14 alignItems: 'center',
15 breakInside: 'avoid'
16 })}>
17 <div
18 className={style({
19 backgroundColor: {
20 color: {
21 white: 'white',
22 black: 'black',
23 accent: 'accent',
24 neutral: 'neutral',
25 negative: 'negative',
26 informative: 'informative',
27 positive: 'positive',
28 notice: 'notice',
29 gray: 'gray',
30 red: 'red',
31 orange: 'orange',
32 yellow: 'yellow',
33 chartreuse: 'chartreuse',
34 celery: 'celery',
35 seafoam: 'seafoam',
36 cyan: 'cyan',
37 blue: 'blue',
38 indigo: 'indigo',
39 purple: 'purple',
40 fuchsia: 'fuchsia',
41 magenta: 'magenta',
42 pink: 'pink',
43 turquoise: 'turquoise',
44 cinnamon: 'cinnamon',
45 brown: 'brown',
46 silver: 'silver'
47 }
48 },
49 size: 20,
50 borderRadius: 'sm',
51 borderWidth: 1,
52 borderColor: 'gray-1000/15',
53 borderStyle: 'solid'
54 })({color: name})}
55 />
56 <div>{name}</div>
57 </div>
58 );
59}
60
61export function IconColors({colors}: {colors: string[]}) {
62 return (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected