दस्तावेज़

इटैलिक

टेक्स्ट को इटैलिक करके ज़ोर दें।

आज़माएँ

“Yurich” चुनकर इटैलिक दबाएँ। परिणाम में <em>Yurich</em> आता है।

लाइव उदाहरण
उदाहरण का परिणाम

एडिटर में जोड़ें

Italic चालू करके बटन से toggleItalic चलाएँ। onMouseDown से चयन बनाए रखें।

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

export function ItalicEditor() {
  const editor = useEditor({
    extensions: [Italic],
    initialValue: "<p>Yurich का इटैलिक रूप देखें।</p>",
  });
  const active = useIsActive(editor, 'toggleItalic');

  return (
    <EditorProvider editor={editor}>
      <button
        type="button"
        aria-pressed={active}
        onMouseDown={event => event.preventDefault()}
        onClick={() => editor.execute('toggleItalic')}
      >
        इटैलिक
      </button>
      <EditorContent ariaLabel="एडिटर" />
    </EditorProvider>
  );
}

ध्यान देने योग्य व्यवहार

Mod+I भी यही करता है। लोड किया गया <i> आउटपुट में <em> बनता है।

सुविधाएँ