Show: Inherited Protected Private Deprecated

# ButtonTwitter Class

Uses:

- ButtonStateClasses

Defined in: `src/ui/react/src/components/buttons/button-twitter.jsx:4`

The ButtonTwitter class provides functionality for creating a link which allows people to tweet part of the content in the editor.

## Index

### Methods

- _getHref
- getStateClasses
- handleClick
- isActive
- render

### Properties

- editor
- key static
- label
- tabIndex

## Methods

### `_getHref`

() String protected

Defined in `src/ui/react/src/components/buttons/button-twitter.jsx:105`

Generates the appropriate twitter url based on the selected text and the configuration options received via props.

#### Returns:

String:

A valid twitter url with the selected text and given configuration.

### `getStateClasses`

() String

Inherited from ButtonStateClasses: `src/ui/react/src/components/base/button-state-classes.js:15`

Returns the list of state classes associated to the current element's state, according to the results of the isActive and isDisabled methods.

#### Returns:

String:

A string with the state CSS classes.

### `handleClick`

()

Defined in `src/ui/react/src/components/buttons/button-twitter.jsx:52`

Creates or removes the twitter link on the selection.

### `isActive`

() Boolean

Defined in `src/ui/react/src/components/buttons/button-twitter.jsx:77`

Checks if the current selection is contained within a link that points to twitter.com/intent/tweet.

#### Returns:

Boolean:

True if the selection is inside a twitter link, false otherwise.

### `render`

() Object

Defined in `src/ui/react/src/components/buttons/button-twitter.jsx:89`

Lifecycle. Renders the UI of the button.

#### Returns:

Object:

The content which should be rendered.

## Properties

### `editor`

Object

Defined in `src/ui/react/src/components/buttons/button-twitter.jsx:17`

The editor instance where the component is being used.

### `key`

String static

Defined in `src/ui/react/src/components/buttons/button-twitter.jsx:42`

The name which will be used as an alias of the button in the configuration.

Default: twitter

### `label`

String

Defined in `src/ui/react/src/components/buttons/button-twitter.jsx:24`

The label that should be used for accessibility purposes.

### `tabIndex`

Number

Defined in `src/ui/react/src/components/buttons/button-twitter.jsx:31`

The tabIndex of the button in its toolbar current state. A value other than -1 means that the button has focus and is the active element.