# शीर्षक {#heading}

Source: [React एडिटर में H1 से H6 तक की हेडिंग जोड़ें · Yurich](https://leeyujoo.com/yurich/hi/features/heading/)

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

Package version: `0.1.2`

पैराग्राफ़ को H1 से H6 तक का शीर्षक बनाएँ।

## आज़माएँ {#try-it}

“अपना टूलबार बनाएँ” में **शीर्षक 2** दबाने पर `<h2>अपना टूलबार बनाएँ</h2>` बनता है। **पैराग्राफ़** से वापस जाएँ।

## एडिटर में जोड़ें {#setup}

`Heading` चालू करें और `setHeading` को 1 से 6 तक की संख्या दें।

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

export function HeadingEditor() {
  const editor = useEditor({
    extensions: [Heading],
    initialValue: "<p>अपना टूलबार बनाएँ</p>" + "<p>पहले एक बोल्ड बटन जोड़ें।</p>",
  });
  const isH2 = useIsActive(editor, 'setHeading', 2);

  return (
    <EditorProvider editor={editor}>
      <div role="group" aria-label="शीर्षक">
        <button
          type="button"
          aria-pressed={isH2}
          onMouseDown={event => event.preventDefault()}
          onClick={() => editor.execute('setHeading', 2)}
        >
          शीर्षक 2
        </button>
        <button
          type="button"
          onMouseDown={event => event.preventDefault()}
          onClick={() => editor.execute('removeHeading')}
        >
          पैराग्राफ़
        </button>
      </div>
      <EditorContent ariaLabel="एडिटर" />
    </EditorProvider>
  );
}
```

## ध्यान देने योग्य व्यवहार {#behavior}

कमांड हर चुने हुए ब्लॉक पर लागू होता है। सूची का आइटम शीर्षक बनने पर सूची से बाहर हो जाता है।

[सुविधाएँ](https://leeyujoo.com/yurich/hi/features/)
