-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stabilize and document the angle picker component.
- Loading branch information
1 parent
26e2bf6
commit b2132a7
Showing
11 changed files
with
85 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# AnglePickerControl | ||
|
||
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. | ||
|
||
## Usage | ||
|
||
|
||
```jsx | ||
import { useState } from '@wordpress/element'; | ||
import { AnglePickerControl } from '@wordpress/components'; | ||
|
||
const MyAnglePicker = () => { | ||
const [ angle, setAngle ] = useState(); | ||
return <AnglePickerControl value={ angle } onChange={ setAngle } />; | ||
}; | ||
``` | ||
|
||
## Props | ||
|
||
The component accepts the following props. | ||
|
||
### label | ||
|
||
Label to use for the angle picker. If not set the a translated label "Angle" is used. | ||
|
||
- Type: `String` | ||
- Required: No | ||
|
||
### value | ||
The current value of the input. The value represents an angle in degrees and should be a value between 0 and 360. | ||
|
||
- Type: `Number` | ||
- Required: Yes | ||
|
||
### onChange | ||
A function that receives the new value of the input. | ||
|
||
- Type: `function` | ||
- Required: Yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters