@wordpress/components
Version:
UI components for WordPress.
36 lines • 1.33 kB
TypeScript
import type { CustomGradientPickerProps } from './types';
/**
* CustomGradientPicker is a React component that renders a UI for specifying
* linear or radial gradients. Radial gradients are displayed in the picker as
* a slice of the gradient from the center to the outside.
*
* This component is deprecated. Use `GradientPicker` with `clearable={ false }`
* instead. Without the `gradients` prop, it renders the same gradient editor
* without presets or a Clear button.
*
* `GradientPicker` types its `onChange` argument as `string | undefined`.
* Without presets or a Clear button it only passes a string, but a callback
* that accepts only a string needs to narrow the value first.
*
* @deprecated Use `GradientPicker` with `clearable={ false }` instead.
*
* ```jsx
* import { GradientPicker } from '@wordpress/components';
* import { useState } from '@wordpress/element';
*
* const MyGradientEditor = () => {
* const [ gradient, setGradient ] = useState();
*
* return (
* <GradientPicker
* clearable={ false }
* value={ gradient }
* onChange={ setGradient }
* />
* );
* };
* ```
*/
export declare function CustomGradientPicker(props: CustomGradientPickerProps): import("react").JSX.Element;
export default CustomGradientPicker;
//# sourceMappingURL=deprecated.d.ts.map