Skip to content

Commit

Permalink
Update BorderRadiusControl README and Story
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukhendu2002 committed Dec 30, 2024
1 parent cc88c00 commit ff8c836
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* WordPress dependencies
*/
import { BorderRadiusControl } from '@wordpress/block-editor';
import { __experimentalBorderRadiusControl as BorderRadiusControl } from '@wordpress/block-editor';
import { useState } from '@wordpress/element';

const MyBorderRadiusControl = () => {
Expand All @@ -26,23 +26,17 @@ const MyBorderRadiusControl = () => {
/>
);
};

// ...

<MyBorderRadiusControl />;
```

## Props

The component accepts the following props:

### values

An object containing the border radius values for each corner.

- **Type:** `Object`
- **Required:** No
- **Default:** `{ topLeft: undefined, topRight: undefined, bottomLeft: undefined, bottomRight: undefined }`
- **Default:** `undefined`

The values object has the following schema:

Expand All @@ -63,16 +57,4 @@ Callback function that is called when any border radius value changes.
- **Required:** Yes
- **Default:** `() => {}`

The function receives the updated values object as its argument.

## Limitations

The component has the following built-in constraints:

- Minimum border radius value: 0
- Maximum values by unit:
- px: 100
- em: 20
- rem: 20

Please refer to the component's stories for more examples of usage.
The function receives the updated values object as its argument.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,4 @@ export const Default = {
/>
);
},
args: {
values: {
topLeft: '10px',
topRight: '10px',
bottomLeft: '10px',
bottomRight: '10px',
},
},
};
Empty file.

0 comments on commit ff8c836

Please sign in to comment.