> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/ueberdosis/tiptap/llms.txt
> Use this file to discover all available pages before exploring further.

# Italic

> Mark text as italic for emphasis.

The Italic extension allows you to mark text as italic. Text is rendered as an `<em>` HTML element by default.

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @tiptap/extension-italic
  ```

  ```bash yarn theme={null}
  yarn add @tiptap/extension-italic
  ```

  ```bash pnpm theme={null}
  pnpm add @tiptap/extension-italic
  ```
</CodeGroup>

## Usage

```typescript theme={null}
import { Editor } from '@tiptap/core'
import Italic from '@tiptap/extension-italic'

const editor = new Editor({
  extensions: [
    Italic,
  ],
})
```

## Keyboard Shortcuts

* `Mod-i` or `Mod-I` - Toggle italic formatting

## Markdown Support

The extension supports markdown syntax for italic text:

* Type `*text*` to create italic text
* Type `_text_` to create italic text

## Configuration Options

<ParamField path="HTMLAttributes" type="Record<string, any>" default="{}">
  HTML attributes to add to the italic element.

  ```typescript theme={null}
  Italic.configure({
    HTMLAttributes: {
      class: 'my-italic-class',
    },
  })
  ```
</ParamField>

## Commands

### setItalic()

Set an italic mark on the current selection.

```typescript theme={null}
editor.commands.setItalic()
```

### toggleItalic()

Toggle the italic mark on the current selection.

```typescript theme={null}
editor.commands.toggleItalic()
```

### unsetItalic()

Remove the italic mark from the current selection.

```typescript theme={null}
editor.commands.unsetItalic()
```

## Source Code

View the source code on GitHub:

* [packages/extension-italic](https://github.com/ueberdosis/tiptap/tree/main/packages/extension-italic)
