Starts an unordered list. * and + do the same thing.
Lists
Markdown gives you three list shapes: numbered, bulleted, and GFM task lists. Each one nests, each one holds block content, and you can mix them freely. When a numbered sequence needs its own visual treatment, reach for the Steps component instead.
Quick Start
A numbered list needs nothing but 1. in front of each line.
- Clone the repository
- Install dependencies
- Start the dev server
1. Clone the repository
2. Install dependencies
3. Start the dev serverAdding Options
Nesting
Indent a bullet by two spaces and it nests under the line above it. Mixing shapes is fine, and a nested list can be ordered under a bulleted parent or the other way round.
- Supports nested lists
- Second level
- Ordered inside bulleted
- Numbering restarts per level
- Second level
- Back to first level
- Supports nested lists
- Second level
1. Ordered inside bulleted
2. Numbering restarts per level
- Back to first levelIndent to the first character after the parent's marker: two spaces after -,
three after 1..
Markers and start numbers
The first number you write sets where the list starts, and the rest renumber from there no matter what you type.
- Third item, because the list opens at three
- Fourth
- Fifth
3. Third item, because the list opens at three
4. Fourth
5. FifthOnly the first number matters. Bulleted lists accept -, *, or +, and
ordered lists accept . or ) after the number. Every combination renders the
same, and Prettier rewrites them all on save, so these have no live form:
* star bullet same output as -
+ plus bullet same output as -
1) paren delimiter same output as 1.
1. one renumbered from the first item
1. two renders as 2, not 1Switching the marker mid-list starts a second list rather than continuing the first.
Advanced
Task lists
- [ ] and - [x] render a disabled checkbox in front of the item. An
uppercase [X] counts as checked, the space inside the brackets is required,
and tasks work at the top level or nested under a numbered parent.
- Install dependencies
- Copy the example environment file
- Set the site password variable
- Set up the project
- Read the quickstart
- Run the setup script
- Write the first page
- Create
app/guides/index.mdx - Add title and description frontmatter
- Create
- [x] Install dependencies
- [x] Copy the example environment file
- [ ] Set the site password variable
1. Set up the project
- [x] Read the quickstart
- [ ] Run the setup script
2. Write the first page
- [x] Create `app/guides/index.mdx`
- [ ] Add title and description frontmatterWrite - [] with no space and you get a plain bullet with two brackets in it.
Block content inside an item
Indent anything to the item's content column and it belongs to that item: extra paragraphs, code fences, blockquotes, even tables.
-
Install the dependencies
The lockfile is the authority here, so use
npm cion a clean checkout.BashBashnpm ci -
Check the result
A failed install leaves
node_moduleshalf-written. Delete it and retry.Command When npm ciClean checkout npm iAdding packages
1. Install the dependencies
The lockfile is the authority here, so use `npm ci` on a clean checkout.
```bash
npm ci
```
2. Check the result
> A failed install leaves `node_modules` half-written. Delete it and retry.
| Command | When |
| -------- | --------------- |
| `npm ci` | Clean checkout |
| `npm i` | Adding packages |Tight and loose spacing
Without blank lines a list stays tight, and the items sit close together.
- Tight item one
- Tight item two
- Tight item one
- Tight item twoPut a blank line between the items and the list turns loose. Each item gets wrapped in a paragraph, which is where the extra vertical space comes from.
-
Loose item one
-
Loose item two
- Loose item one
- Loose item twoLooseness belongs to the list, not to the item. One blank line anywhere in a ten-item list spaces out all ten.
Options
-marker1.markerStarts an ordered list. 1) works too, and the first number sets the start
value.
- [ ]markerAn unchecked task list item. Write - [x] or - [X] for a checked one. The
space between the brackets is required.
two spacesindentIndents an item one level under the item above it. Use three spaces under an
ordered parent so the content lines up past 1..
blank linespacingA blank line between any two items turns the whole list loose and adds paragraph spacing to every item in it.