# Bulleted list {#unordered-list}

Source: [Add bulleted lists to a React editor · Yurich](https://leeyujoo.com/yurich/features/unordered-list/)

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

Package version: `0.1.2`

Group items into a bulleted list.

## Try it {#try-it}

Select “A Bold button” and “A snack for code review” across both paragraphs. Click **Bulleted list** and check for a `<ul>` with two `<li>` elements.

## Add it to your editor {#setup}

Enable `UnorderedList` and connect a button to `toggleUnorderedList`. The command converts paragraphs or selected list items to a bulleted list.

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

export function UnorderedListEditor() {
  const editor = useEditor({
    extensions: [UnorderedList],
    initialValue: "<p>A Bold button</p><p>A snack for code review</p>",
  });
  const active = useIsActive(editor, 'toggleUnorderedList');

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

## Behavior to account for {#behavior}

You can register `OrderedList` alongside it and convert a selection between the two types. Only the selected items change when converting part of a list.

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