# Sublinhado {#underline}

Source: [Sublinhe texto no editor React · Yurich](https://leeyujoo.com/yurich/pt-br/features/underline/)

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

Package version: `0.1.2`

Trace uma linha sob o texto selecionado.

## Experimente {#try-it}

Selecione “Yurich” e clique em **Sublinhado**. O resultado inclui `<u>Yurich</u>`. Clique novamente para remover.

## Adicione ao seu editor {#setup}

Ative `Underline` e chame `toggleUnderline` a partir do botão.

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

export function UnderlineEditor() {
  const editor = useEditor({
    extensions: [Underline],
    initialValue: "<p>Trace uma linha sob o Yurich.</p>",
  });
  const active = useIsActive(editor, 'toggleUnderline');

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

## Como o recurso se comporta {#behavior}

Use `Mod+U`. Para um texto que abre um endereço, ative `Link`.

[Recursos](https://leeyujoo.com/yurich/pt-br/features/)
