react-leetcode-calendar v2.3.1
React LeetCode Calendar š
Easily display a LeetCode submission calendar in your React projects! š
This library provides a GitHub-like activity graph for LeetCode submissions.
Supports fetching and displaying daily coding activity with an auto-provided QueryClient (no extra setup required).
š Features
ā
Auto-fetches LeetCode submission history
ā
Displays a visual calendar of coding activity
ā
Supports yearly and full-history views
ā
Zero configuration required for React Query
ā
Lightweight & Easy to Use
š¦ Installation
Install the package using npm or yarn:
npm install react-leetcode-calendar
# or
yarn add react-leetcode-calendar
š Usage
Example 1: Passing both username and graph props
import { Leetcodecalendar } from "react-leetcode-calendar";
const App = () => {
return (
<div style={{ background: "#101828", color: "white", display: "flex", justifyContent: "center" }}>
<Leetcodecalendar username={"saurabhhh777"} graph={"yearly"} />
</div>
);
};
export default App;
š Example Output
Example 2: Passing only the username prop
import { Leetcodecalendar } from "react-leetcode-calendar";
const App = () => {
return (
<div style={{ background: "#101828", color: "white", display: "flex", justifyContent: "center" }}>
<Leetcodecalendar username={"saurabhhh777"} />
</div>
);
};
export default App;
š Example Output
šÆ Props
š How It Works?
- When graph="yearly" ā The last 1 year of data from the current date will be displayed.
- When no graph prop is provided ā It will automatically detect the first & last submission dates and display only that range.
š Links
š License
This project is licensed under the MIT License.
ā Star this repo if you found it useful! š š¢ Contributions & Issues are welcome!