# Miring {#italic}

Source: [Tambahkan tombol miring ke editor React · Yurich](https://leeyujoo.com/yurich/id/features/italic/)

Package: [`yurich`](https://www.npmjs.com/package/yurich)

Package version: `0.1.2`

Beri penekanan pada teks dengan huruf miring.

## Coba sendiri {#try-it}

Pilih “Yurich” dan klik **Miring** untuk menghasilkan `<em>Yurich</em>`.

## Tambahkan ke editor {#setup}

Aktifkan `Italic` untuk menjalankan `toggleItalic` pada pilihan teks.

```tsx
import { EditorContent, EditorProvider, Italic, useEditor, useIsActive } from 'yurich';

export function ItalicEditor() {
  const editor = useEditor({
    extensions: [Italic],
    initialValue: "<p>Coba buat Yurich miring.</p>",
  });
  const active = useIsActive(editor, 'toggleItalic');

  return (
    <EditorProvider editor={editor}>
      <button
        type="button"
        aria-pressed={active}
        onMouseDown={event => event.preventDefault()}
        onClick={() => editor.execute('toggleItalic')}
      >
        Miring
      </button>
      <EditorContent ariaLabel="Editor" />
    </EditorProvider>
  );
}
```

## Perilaku yang perlu diperhatikan {#behavior}

Pintasan `Mod+I` juga berlaku. Tag masukan `<i>` dinormalisasi menjadi `<em>`.

[Fitur](https://leeyujoo.com/yurich/id/features/)
