diff --git a/README.md b/README.md
index a76ab9c..51ff2b7 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,16 @@
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
+⚛️ 🎲
+
# React Mchine
A React component that use the [mchine](https://github.com/HenriqueLimas/mchine) library to use state machine in your application.
## Why?
-A state machine can be hard at first to use and understand, but using it as a React component could it be
-easier to apply in your application. State machine are sexy and it will change how you think and develop a
-Front-end application. Think more on your view's state instead of his transactions, this will reduce a lot
-of the if else and make the code more maintanable.
+A state machine can be hard at first to use and understand, but using it as a React component could it be
+easier to apply in your application. State machine are sexy and it will change how you think and develop a
+Front-end application. Think more on your view's state instead of his transactions, this will reduce a lot
+the `if`s and `else`s and make the code more maintanable.
## Install
@@ -24,7 +26,122 @@ npm install react-mchine
yarn add react-mchine
```
+### How to use
+
+#### Wrapping your Component
+
+Wrap your component with a state machine schema using the `withMchine` function:
+
+```js
+import React from 'react';
+import { withMchine } from 'react-mchine';
+import stateMachine from './myStateMachine';
+
+class Component extends React.Component {
+ ...
+}
+
+export default withMchine(stateMachine)(Component);
+```
+
+The wrapped component will have a prop called `transition` that is a function that you can use to change states.
+
+```js
+class Component extends React.Component {
+ handleLogin = () => {
+ this.props.transition('login')
+ }
+}
+```
+
+This is an example of the state machine schema:
+
+```js
+// myStateMachine.js
+
+const stateMachine = {
+ initial: 'idle',
+ states: {
+ idle: {
+ events: {
+ login: {
+ target: 'loading'
+ }
+ }
+ },
+ loading: {
+ events: {
+ success: {
+ target: 'idle'
+ }
+ }
+ }
+ }
+};
+
+export default stateMachine;
+```
+
+#### Matching states
+
+Inside your Wrapped component now you can use the `