make type optional and fall back to 'text'
fix tabs -> spaces
make error prop more declarative