Skip to content

Instantly share code, notes, and snippets.

@r3dm1ke
Created February 21, 2020 15:07
Show Gist options
  • Select an option

  • Save r3dm1ke/e3458660890ac4b4fc508b9872f7da19 to your computer and use it in GitHub Desktop.

Select an option

Save r3dm1ke/e3458660890ac4b4fc508b9872f7da19 to your computer and use it in GitHub Desktop.
import React from 'react';
import {TextField, InputAdornment, makeStyles} from "@material-ui/core";
import SearchIcon from '@material-ui/icons/Search';
const useStyles = makeStyles({
input: {
width: '100%'
}
});
const SearchBar = ({value, onChange}) => {
const classes = useStyles();
return (
<TextField
className={classes.input}
label='Search for repos...'
type='search'
variant='outlined'
InputProps={{
endAdornment: (
<InputAdornment position='end'>
<SearchIcon />
</InputAdornment>
),
}}
value={value}
onChange={e => onChange(e.target.value)}
/>
);
};
export default SearchBar;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment