# Tebal {#bold}

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

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

Package version: `0.1.2`

Tebalkan teks yang dipilih.

## Coba sendiri {#try-it}

Pilih “Yurich” lalu klik **Tebal**. Keluaran memuat `<strong>Yurich</strong>`. Klik lagi untuk melepas format.

## Tambahkan ke editor {#setup}

Tambahkan `Bold` ke `extensions` dan hubungkan tombol ke `toggleBold`.

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

export function BoldEditor() {
  const editor = useEditor({
    extensions: [Bold],
    initialValue: "<p>Yurich layak diberi sedikit penekanan.</p>",
  });
  const active = useIsActive(editor, 'toggleBold');

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

## Perilaku yang perlu diperhatikan {#behavior}

Pintasan `Mod+B` menjalankan perintah yang sama. Kursor saja tidak mengubah format.

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