The GitHub User Search Component is a reusable React component that allows users to search for GitHub users and display the search results.
- User can enter a search query.
- User can click on the "Search" button to initiate the search.
- The component makes an API call to the GitHub API to fetch user data based on the search query.
- The component displays the search results, including the user's avatar, username, and a link to their GitHub profile.
To use the GitHub User Search Component in your React.js web app, follow these steps:
- Install the required dependencies:
npm install @material-ui/core
- Import the 'UserSearch' component in your app:
import UserSearch from './UserSearch';
- Add the UserSearch component to your app's JSX code:
<UserSearch />
- Ensure that you have a suitable container element to render the component.
Here's an example of how you can use the GitHub User Search Component in your React.js app:
import React from 'react';
import UserSearch from './UserSearch';
function App() {
return (
<div>
<h1>My React App</h1>
<UserSearch />
</div>
);
}
export default App;
The GitHub User Search Component uses Material-UI for styling. You can customize the component's appearance by overriding the CSS classes used in the component's makeStyles hook.
TThe GitHub User Search Component was created by Pranav Dharme.
Happy coding!