Skip to content

Commit

Permalink
docs(API): Update props API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hibiken committed Jul 12, 2016
1 parent 8c8ded8 commit f1b5131
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,40 @@ Required: `true`

Please see the example above

#### classNames
Type: `object`
Require: `false`

You can give a custom css classes to elements
Accepted keys are `container`, `label`, `input`, `autocompleteContainer`

```js
// classNames example
render() {
const cssClasses = {
container: 'form-group',
label: 'form-label',
input: 'form-control',
autocompleteContainer: 'my-autocomplete-container'
}

return (
<PlacesAutocomplete
value={this.state.address}
setAddress={this.setAddress}
classNames={cssClasses}
/>
)
}
```
Now you can easily apply custom CSS styles using the classNames!

#### placeholder
Type: `String`
Required: `false`
Default: `"Address"`

You can pass placeholder prop to customize input's placeholder text


### `geocodeByAddress` API
Expand Down
16 changes: 0 additions & 16 deletions src/tests/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,27 +110,11 @@ describe('custom classNames, placeholder', () => {
})

it('lets you set a custom placeholder for the input', () => {
//console.log(wrapper.find('input').props().placeholder)
expect(wrapper.find('input').props().placeholder).to.equal('Your Address')
})
});

















// TODO: test geocodeByAddress function
describe('geocodeByAddress', () => {
it('should be true', () => {
Expand Down

0 comments on commit f1b5131

Please sign in to comment.