@material/react-text-field
Version:
Material Components React Text Field
41 lines (28 loc) • 1.53 kB
Markdown
MDC React Text Field Icon is a React Component which uses MDC [MDC Text Field Icon](https://github.com/material-components/material-components-web/tree/master/packages/mdc-textfield/icon/)'s CSS and foundation JavaScript.
```js
import Icon from '@material/react-text-field/icon/index.js';
const MyComponent = () => {
return (
<Icon>
<i className='material-icons' />
</Icon>
);
}
```
Prop Name | Type | Description
--- | --- | ---
disabled | Boolean | Toggles the disabled state of the icon.
children | Element | Required. Expects a single child icon element.
onSelect | Function() => void | Optional callback for user interaction with icon
> Notes: `onSelect` fired on click event and "Enter key" keydown event.
> `onSelect` will add tabindex of 0 if tabindex is not previously added to icon
The icon can be a `<a>`, `<i>`, `<svg>`, `<image>`, `<span>`, etc.
If you decide to use a React Component please see [Integrating with Components](./../../../docs/guidelines.md
Sass mixins may be available to customize various aspects of the Components. Please refer to the
MDC Web repository for more information on what mixins are available, and how to use them.
[](https://github.com/material-components/material-components-web/blob/master/packages/mdc-textfield/icon/README.md#sass-mixins)