# Coretan {#strikethrough}

Source: [Coret teks di editor React · Yurich](https://leeyujoo.com/yurich/id/features/strikethrough/)

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

Package version: `0.1.2`

Coret teks tanpa menghapusnya.

## Coba sendiri {#try-it}

Pilih “Yurich” dan klik **Coret**. Keluaran memuat `<s>Yurich</s>` dan teksnya tetap ada.

## Tambahkan ke editor {#setup}

Aktifkan `Strikethrough` dan panggil `toggleStrikethrough`.

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

export function StrikethroughEditor() {
  const editor = useEditor({
    extensions: [Strikethrough],
    initialValue: "<p>Coret Yurich dan lihat apa yang tersisa.</p>",
  });
  const active = useIsActive(editor, 'toggleStrikethrough');

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

## Perilaku yang perlu diperhatikan {#behavior}

Pintasannya `Mod+Shift+S`. Tag `<del>` dari HTML masukan menjadi `<s>`.

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