AnglePickerControl 是一个 React 组件,用于渲染允许用户选择角度的 UI。用户可以通过在圆形内拖动角度指示器或直接在文本字段中输入角度来交互式地选择角度。
import { useState } from '@wordpress/element';
import { AnglePickerControl } from '@wordpress/components';
function Example() {
const [ angle, setAngle ] = useState( 0 );
return (
<AnglePickerControl
value={ angle }
onChange={ setAngle }
/>
);
}See the WordPress Storybook for more detailed, interactive documentation.
AnglePickerControl is a React component to render a UI that allows users to
pick an angle. Users can choose an angle in a visual UI with the mouse by
dragging an angle indicator inside a circle or by directly inserting the
desired angle in a text field.
import { useState } from '@wordpress/element';
import { AnglePickerControl } from '@wordpress/components';
function Example() {
const [ angle, setAngle ] = useState( 0 );
return (
<AnglePickerControl
value={ angle }
onChange={ setAngle }
/>
);
}
as"symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | ...The HTML element or React component to render the component as.
labelstring__( 'Angle' )Label to use for the angle picker.
onChange(value: number) => voidA function that receives the new value of the input.
valuestring | numberThe current value of the input. The value represents an angle in degrees
and should be a value between 0 and 360.