# Conditional rendering with if else

> You can use v-if and v-else directives for conditional rendering, as follows: More details here.

- Canonical: https://preview.arshadmehmood.com/today-i-learned/vuejs/conditional-rendering-with-if-else/
- Section: vuejs
- Author: Arshad Mehmood

You can use `v-if` and `v-else` directives for conditional rendering, as follows:

```js
<div v-if="Math.random() > 0.5">
  Now you see me
</div>
<div v-else>
  Now you don't
</div>
```

More details [here](https://vuejs.org/v2/guide/conditional.html).

