Installation
Usage
Without Label
Hide the “GitHub” label by settingshowLabel to false:
Sizes
The button supports three sizes through thesize prop:
Variants
Props
The GitHub repository in the format
owner/repo (e.g., "theexperiencecompany/gaia").Whether to show the “GitHub” label text next to the icon.
The size of the button. Inherits from the Raised Button component.
Additional CSS classes to apply to the button.
Features
- Real-time Data: Fetches star count from GitHub API on component mount
- Loading State: Shows loading indicator while fetching data
- Error Handling: Gracefully handles API failures
- Responsive: Built on the Raised Button component with all its features
- Hover Effect: Star icon changes to yellow on hover
- Direct Link: Clicking opens the GitHub repository in a new tab
- Memory Safe: Properly cleans up side effects to prevent memory leaks
API Rate Limiting
The GitHub API has rate limits for unauthenticated requests:- 60 requests per hour per IP address
- Consider implementing caching if you expect high traffic
- For production use with higher limits, consider adding a GitHub token
Accessibility
- Semantic
<a>tag for proper link behavior target="_blank"withrel="noopener noreferrer"for security- Inherits all accessibility features from Raised Button
- Loading state communicated through text content