Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added documentation for the text-decoration-control component #57184

Binary file added docs/assets/text-decoration-component.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# TextDecorationControl

![TextDecorationControl Element in Inspector Control](https://raw.githubusercontent.com/WordPress/gutenberg/HEAD/docs/assets/text-decoration-component.png?raw=true)

## Table of Contents

1. [Usage](#usage)
3. [Properties](#props)
aaronrobertshaw marked this conversation as resolved.
Show resolved Hide resolved

## Usage
aaronrobertshaw marked this conversation as resolved.
Show resolved Hide resolved

```jsx
import { TextDecorationControl } from '@wordpress/block-editor';
aaronrobertshaw marked this conversation as resolved.
Show resolved Hide resolved
```

Then, you can use the component in your block editor UI:

```jsx
<TextDecorationControl
value={textDecorationValue}
onChange={(newValue) => setAttributes({ textDecoration: newValue })}
/>
```

### Props

### `value`

- **Type:** `String`
- **Default:** `none`
- **Options:** `none`, `underline`, `line-through`

The current value of the Text Decoration setting. You may only choose from the `Options` listed above.

### `onChange`

- **Type:** `Function`

A callback function invoked when the Text Decoration value is changed via an interaction with any of the buttons. Called with the Text Decoration value (`none`, `underline`, `line-through`) as the only argument.
Loading