# इनलाइन कोड {#code}

Source: [React एडिटर में इनलाइन कोड फ़ॉर्मैट करें · Yurich](https://leeyujoo.com/yurich/hi/features/code/)

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

Package version: `0.1.2`

पैराग्राफ़ में छोटा कोड फ़ॉर्मैट करें।

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

“fetch()” चुनकर **इनलाइन कोड** दबाएँ। आउटपुट में `<code>fetch()</code>` आता है।

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

`Code` चालू करें और पैराग्राफ़ के छोटे टुकड़े के लिए `toggleCode` चलाएँ।

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

export function CodeEditor() {
  const editor = useEditor({
    extensions: [Code],
    initialValue: "<p>अगला ड्राफ़्ट fetch() से लाएँ।</p>",
  });
  const active = useIsActive(editor, 'toggleCode');

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

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

कई लाइन वाले अलग हिस्से के लिए [कोड ब्लॉक](https://leeyujoo.com/yurich/hi/features/code-block/) इस्तेमाल करें।

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