ColorSwatch
A visible color sample, including alpha transparency.
Usage
import { ColorSwatch } from "@lenso/ui";"use client";
import { ColorSwatch } from "@lenso/ui";import * as stylex from "@stylexjs/stylex";
const styles = stylex.create({ row: { display: "flex", alignItems: "center", gap: 12 } });export function ColorSwatchBasic() { return ( <div {...stylex.props(styles.row)}> <ColorSwatch aria-label="Blue" color="#0485F7" /> <ColorSwatch aria-label="Red" color="#EF4444" /> <ColorSwatch aria-label="Amber" color="#F59E0B" /> <ColorSwatch aria-label="Green" color="#10B981" /> <ColorSwatch aria-label="Fuchsia" color="#D946EF" /> </div> );}Examples
color swatch sizes
"use client";/** Adapted from HeroUI v3.2.6. Apache-2.0. */import { ColorSwatch } from "@lenso/ui";import * as stylex from "@stylexjs/stylex";import { styles } from "../color-picker/source.stylex";export function ColorSwatchSizes() { return ( <div {...stylex.props(styles.row)}> <ColorSwatch color="#0485F7" size="xs" /> <ColorSwatch color="#EF4444" size="sm" /> <ColorSwatch color="#F59E0B" size="md" /> <ColorSwatch color="#10B981" size="lg" /> <ColorSwatch color="#D946EF" size="xl" /> </div> );}color swatch shapes
"use client";/** Adapted from HeroUI v3.2.6. Apache-2.0. */import { ColorSwatch } from "@lenso/ui";import * as stylex from "@stylexjs/stylex";import { styles } from "../color-picker/source.stylex";export function ColorSwatchShapes() { return ( <div {...stylex.props(styles.row)}> <ColorSwatch color="#0485F7" shape="circle" /> <ColorSwatch color="#0485F7" shape="square" /> </div> );}color swatch transparency
"use client";/** Adapted from HeroUI v3.2.6. Apache-2.0. */import { ColorSwatch } from "@lenso/ui";import * as stylex from "@stylexjs/stylex";import { styles } from "../color-picker/source.stylex";export function ColorSwatchTransparency() { return ( <div {...stylex.props(styles.row)}> {[1, 0.75, 0.5, 0.25, 0].map((alpha) => ( <ColorSwatch key={alpha} aria-label={`${alpha * 100}% opacity`} color={`rgba(4, 133, 247, ${alpha})`} /> ))} </div> );}color swatch render function
"use client";/** Adapted from HeroUI v3.2.6. Apache-2.0. Native RAC style render state replaces DOM render interception. */import { ColorSwatch } from "@lenso/ui";import * as stylex from "@stylexjs/stylex";import { styles } from "../color-picker/source.stylex";const colors = [ ["Blue", "#0485F7"], ["Red", "#EF4444"], ["Amber", "#F59E0B"], ["Green", "#10B981"], ["Fuchsia", "#D946EF"],] as const;export function RenderFunction() { return ( <div {...stylex.props(styles.row)}> {colors.map(([name, color]) => ( <ColorSwatch key={name} aria-label={name} color={color} data-custom={name.toLowerCase()} style={({ color: c }) => ({ outlineColor: c.toString("css") })} /> ))} </div> );}color swatch accessibility
"use client";/** Adapted from HeroUI v3.2.6. Apache-2.0. */import { ColorSwatch } from "@lenso/ui";import * as stylex from "@stylexjs/stylex";import { styles } from "../color-picker/source.stylex";export function ColorSwatchAccessibility() { return ( <div {...stylex.props(styles.row)}> <ColorSwatch aria-label="Primary brand color" color="#0485F7" colorName="Ocean Blue" /> <ColorSwatch aria-label="Error state color" color="#EF4444" colorName="Coral Red" /> <ColorSwatch aria-label="Warning color" color="#F59E0B" colorName="Sunset Orange" /> </div> );}color swatch custom styles
"use client";/** Adapted from HeroUI v3.2.6. Apache-2.0. */import { ColorSwatch } from "@lenso/ui";import * as stylex from "@stylexjs/stylex";import { styles } from "../color-picker/source.stylex";const colors = ["#0485F7", "#EF4444", "#F59E0B", "#10B981", "#D946EF"];export function ColorSwatchCustomStyles() { return ( <div {...stylex.props(styles.column8)}> <div {...stylex.props(styles.column2)}> <span {...stylex.props(styles.muted)}>Glow Effect</span> <div {...stylex.props(styles.row4)}> {colors.map((color) => ( <ColorSwatch key={color} color={color} size="xl" style={() => ({ boxShadow: `0 0 20px 2px ${color}` })} /> ))} </div> </div> <div {...stylex.props(styles.column2)}> <span {...stylex.props(styles.muted)}>Gradient</span> <div {...stylex.props(styles.row4)}> {colors.map((color) => ( <ColorSwatch key={color} color={color} size="xl" style={({ color: c }) => ({ background: `linear-gradient(135deg, ${c.toString("css")}, white)`, })} /> ))} </div> </div> </div> );}API Reference
Generated from the local public TypeScript exports. Types and callback state follow the installed native contracts, not the historical HeroUI API.
Only literal defaults in the component's parameter declaration are shown. Other defaults may depend on context or the native component.
ColorSwatchRoot
({ size, shape, xstyle, style, ...props }: ColorSwatchRootProps): JSX.Element
packages/react/src/components/color-swatch/color-swatch.tsx:13
react-aria-components/ColorSwatch
| Property | Type | Required | Local default | Description |
|---|---|---|---|---|
color | string | Color | undefined | No | Not declared | The color value to display in the swatch.node_modules/react-aria/dist/types/src/color/useColorSwatch.d.ts:6 |
translate | undefined | "yes" | "no" | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:303 |
hidden | undefined | false | true | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:301 |
style | StyleOrFunction<ColorSwatchRenderProps> | undefined | No | Not declared | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.node_modules/react-aria-components/dist/types/src/utils.d.ts:132 |
slot | string | null | undefined | No | Not declared | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent.node_modules/react-aria-components/dist/types/src/utils.d.ts:172 |
dir | string | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:299 |
ref | Ref<HTMLDivElement> | undefined | No | Not declared | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).node_modules/@types/react/index.d.ts:301 |
id | string | undefined | No | Not declared | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).node_modules/@react-types/shared/src/dom.d.ts:75 |
lang | string | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:300 |
inert | undefined | false | true | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:302 |
aria-describedby | string | undefined | No | Not declared | Identifies the element (or elements) that describes the object.node_modules/@react-types/shared/src/dom.d.ts:51 |
aria-details | string | undefined | No | Not declared | Identifies the element (or elements) that provide a detailed, extended description for the object.node_modules/@react-types/shared/src/dom.d.ts:57 |
aria-label | string | undefined | No | Not declared | Defines a string value that labels the current element.node_modules/@react-types/shared/src/dom.d.ts:41 |
aria-labelledby | string | undefined | No | Not declared | Identifies the element (or elements) that labels the current element.node_modules/@react-types/shared/src/dom.d.ts:46 |
onAuxClick | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:322 |
onAuxClickCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:323 |
onClick | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:320 |
onClickCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:321 |
onContextMenu | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:324 |
onContextMenuCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:325 |
onDoubleClick | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:326 |
onDoubleClickCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:327 |
onMouseDown | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:328 |
onMouseDownCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:329 |
onMouseEnter | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:330 |
onMouseLeave | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:331 |
onMouseMove | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:332 |
onMouseMoveCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:333 |
onMouseOut | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:334 |
onMouseOutCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:335 |
onMouseOver | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:336 |
onMouseOverCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:337 |
onMouseUp | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:338 |
onMouseUpCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:339 |
onTouchCancel | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:342 |
onTouchCancelCapture | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:343 |
onTouchEnd | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:344 |
onTouchEndCapture | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:345 |
onTouchMove | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:346 |
onTouchMoveCapture | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:347 |
onTouchStart | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:348 |
onTouchStartCapture | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:349 |
onPointerDown | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:352 |
onPointerDownCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:353 |
onPointerMove | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:354 |
onPointerMoveCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:355 |
onPointerUp | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:356 |
onPointerUpCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:357 |
onPointerCancel | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:358 |
onPointerCancelCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:359 |
onPointerEnter | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:360 |
onPointerLeave | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:361 |
onPointerOver | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:362 |
onPointerOverCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:363 |
onPointerOut | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:364 |
onPointerOutCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:365 |
onGotPointerCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:366 |
onGotPointerCaptureCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:367 |
onLostPointerCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:368 |
onLostPointerCaptureCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:369 |
onScroll | UIEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:372 |
onScrollCapture | UIEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:373 |
onWheel | WheelEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:376 |
onWheelCapture | WheelEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:377 |
onAnimationStart | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:380 |
onAnimationStartCapture | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:381 |
onAnimationEnd | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:382 |
onAnimationEndCapture | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:383 |
onAnimationIteration | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:384 |
onAnimationIterationCapture | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:385 |
onTransitionCancel | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:388 |
onTransitionCancelCapture | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:389 |
onTransitionEnd | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:390 |
onTransitionEndCapture | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:391 |
onTransitionRun | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:392 |
onTransitionRunCapture | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:393 |
onTransitionStart | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:394 |
onTransitionStartCapture | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:395 |
render | DOMRenderFunction<"div", ColorSwatchRenderProps> | undefined | No | Not declared | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.node_modules/react-aria-components/dist/types/src/utils.d.ts:208 |
colorName | string | undefined | No | Not declared | A localized accessible name for the color. By default, a description is generated from the color value, but this can be overridden if you have a more specific color name (e.g. Pantone colors).node_modules/react-aria/dist/types/src/color/useColorSwatch.d.ts:13 |
xstyle | XStyle | No | Not declared | packages/react/src/utils/styled.tsx:7 |
data-slot | unknown | No | Not declared | packages/react/src/utils/styled.tsx:8 |
size | undefined | "xs" | "sm" | "md" | "lg" | "xl" | No | "md" | packages/react/src/components/color-swatch/color-swatch.tsx:9 |
shape | undefined | "square" | "circle" | No | "circle" | packages/react/src/components/color-swatch/color-swatch.tsx:10 |
Callback state: ColorSwatchRenderProps & { defaultStyle: CSSProperties; }
colorColordefaultStyleCSSProperties
Callback state: ColorSwatchRenderProps
colorColor
ColorSwatch
({ size, shape, xstyle, style, ...props }: ColorSwatchRootProps): JSX.Element
packages/react/src/components/color-swatch/index.ts:8
ColorSwatch.Root
| Property | Type | Required | Local default | Description |
|---|---|---|---|---|
color | string | Color | undefined | No | Not declared | The color value to display in the swatch.node_modules/react-aria/dist/types/src/color/useColorSwatch.d.ts:6 |
translate | undefined | "yes" | "no" | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:303 |
hidden | undefined | false | true | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:301 |
style | StyleOrFunction<ColorSwatchRenderProps> | undefined | No | Not declared | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.node_modules/react-aria-components/dist/types/src/utils.d.ts:132 |
slot | string | null | undefined | No | Not declared | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent.node_modules/react-aria-components/dist/types/src/utils.d.ts:172 |
dir | string | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:299 |
ref | Ref<HTMLDivElement> | undefined | No | Not declared | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).node_modules/@types/react/index.d.ts:301 |
id | string | undefined | No | Not declared | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).node_modules/@react-types/shared/src/dom.d.ts:75 |
lang | string | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:300 |
inert | undefined | false | true | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:302 |
aria-describedby | string | undefined | No | Not declared | Identifies the element (or elements) that describes the object.node_modules/@react-types/shared/src/dom.d.ts:51 |
aria-details | string | undefined | No | Not declared | Identifies the element (or elements) that provide a detailed, extended description for the object.node_modules/@react-types/shared/src/dom.d.ts:57 |
aria-label | string | undefined | No | Not declared | Defines a string value that labels the current element.node_modules/@react-types/shared/src/dom.d.ts:41 |
aria-labelledby | string | undefined | No | Not declared | Identifies the element (or elements) that labels the current element.node_modules/@react-types/shared/src/dom.d.ts:46 |
onAuxClick | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:322 |
onAuxClickCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:323 |
onClick | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:320 |
onClickCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:321 |
onContextMenu | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:324 |
onContextMenuCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:325 |
onDoubleClick | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:326 |
onDoubleClickCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:327 |
onMouseDown | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:328 |
onMouseDownCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:329 |
onMouseEnter | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:330 |
onMouseLeave | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:331 |
onMouseMove | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:332 |
onMouseMoveCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:333 |
onMouseOut | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:334 |
onMouseOutCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:335 |
onMouseOver | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:336 |
onMouseOverCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:337 |
onMouseUp | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:338 |
onMouseUpCapture | MouseEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:339 |
onTouchCancel | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:342 |
onTouchCancelCapture | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:343 |
onTouchEnd | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:344 |
onTouchEndCapture | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:345 |
onTouchMove | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:346 |
onTouchMoveCapture | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:347 |
onTouchStart | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:348 |
onTouchStartCapture | TouchEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:349 |
onPointerDown | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:352 |
onPointerDownCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:353 |
onPointerMove | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:354 |
onPointerMoveCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:355 |
onPointerUp | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:356 |
onPointerUpCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:357 |
onPointerCancel | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:358 |
onPointerCancelCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:359 |
onPointerEnter | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:360 |
onPointerLeave | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:361 |
onPointerOver | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:362 |
onPointerOverCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:363 |
onPointerOut | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:364 |
onPointerOutCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:365 |
onGotPointerCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:366 |
onGotPointerCaptureCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:367 |
onLostPointerCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:368 |
onLostPointerCaptureCapture | PointerEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:369 |
onScroll | UIEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:372 |
onScrollCapture | UIEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:373 |
onWheel | WheelEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:376 |
onWheelCapture | WheelEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:377 |
onAnimationStart | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:380 |
onAnimationStartCapture | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:381 |
onAnimationEnd | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:382 |
onAnimationEndCapture | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:383 |
onAnimationIteration | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:384 |
onAnimationIterationCapture | AnimationEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:385 |
onTransitionCancel | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:388 |
onTransitionCancelCapture | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:389 |
onTransitionEnd | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:390 |
onTransitionEndCapture | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:391 |
onTransitionRun | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:392 |
onTransitionRunCapture | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:393 |
onTransitionStart | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:394 |
onTransitionStartCapture | TransitionEventHandler<HTMLDivElement> | undefined | No | Not declared | node_modules/@react-types/shared/src/dom.d.ts:395 |
render | DOMRenderFunction<"div", ColorSwatchRenderProps> | undefined | No | Not declared | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.node_modules/react-aria-components/dist/types/src/utils.d.ts:208 |
colorName | string | undefined | No | Not declared | A localized accessible name for the color. By default, a description is generated from the color value, but this can be overridden if you have a more specific color name (e.g. Pantone colors).node_modules/react-aria/dist/types/src/color/useColorSwatch.d.ts:13 |
xstyle | XStyle | No | Not declared | packages/react/src/utils/styled.tsx:7 |
data-slot | unknown | No | Not declared | packages/react/src/utils/styled.tsx:8 |
size | undefined | "xs" | "sm" | "md" | "lg" | "xl" | No | "md" | packages/react/src/components/color-swatch/color-swatch.tsx:9 |
shape | undefined | "square" | "circle" | No | "circle" | packages/react/src/components/color-swatch/color-swatch.tsx:10 |
Callback state: ColorSwatchRenderProps & { defaultStyle: CSSProperties; }
colorColordefaultStyleCSSProperties
Callback state: ColorSwatchRenderProps
colorColor
Shared native HTML and ARIA properties
Parts with identical inherited property records share one complete table. Different native types remain separate.
Property set 1 (1)
Applies to: ColorSwatchRoot, ColorSwatch
| Property | Type | Required | Local default | Description |
|---|---|---|---|---|
key | Key | null | undefined | No | Not declared | node_modules/@types/react/index.d.ts:259 |
HeroUI v3.2.6 is the visual and historical reference, not an API compatibility promise. HeroUI v3.2.6