Skip to content

Commit 8d3a66e

Browse files
committed
add README
1 parent 247a27c commit 8d3a66e

File tree

2 files changed

+87
-2
lines changed

2 files changed

+87
-2
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# TutorialSection Component
2+
3+
A tabbed interface for displaying tutorial links organized by category.
4+
5+
## What is this?
6+
7+
The TutorialSection component displays a collection of tutorials in a clean, organized layout with tabs. Each tab represents a category of tutorials (like "Getting Started" or "Advanced"), and clicking on a tab shows the relevant tutorials as clickable cards.
8+
9+
This component is useful when you have multiple tutorials and want to group them by topic or difficulty level, making it easier for users to find what they need.
10+
11+
## Usage
12+
13+
```tsx
14+
import { TutorialSection } from "@components/TutorialSection/TutorialSection"
15+
16+
;<TutorialSection
17+
tabs={[
18+
{
19+
name: "Getting Started",
20+
links: [
21+
{
22+
title: "Quick Start Guide",
23+
description: "Learn the basics in 5 minutes",
24+
link: "/docs/quickstart",
25+
},
26+
{
27+
title: "Installation",
28+
description: "Set up your development environment",
29+
link: "/docs/installation",
30+
},
31+
],
32+
},
33+
{
34+
name: "Advanced",
35+
links: [
36+
{
37+
title: "Architecture Overview",
38+
description: "Understand the system design",
39+
link: "/docs/architecture",
40+
},
41+
],
42+
},
43+
]}
44+
/>
45+
```
46+
47+
## How to set it up
48+
49+
The component requires a `tabs` prop, which is an array of tab objects. Each tab object contains:
50+
51+
- A **name** (the label shown on the tab button)
52+
- A list of **links** (the tutorials shown when that tab is active)
53+
54+
Each tutorial link needs three pieces of information:
55+
56+
- **title** - The name of the tutorial
57+
- **description** - A short sentence explaining what the tutorial covers
58+
- **link** - The URL where the tutorial can be found
59+
60+
## Props Reference
61+
62+
### `TutorialSection`
63+
64+
| Prop | Type | Required | Description |
65+
| ------ | ------- | -------- | ----------------------------------------------------- |
66+
| `tabs` | `Tab[]` | Yes | List of tabs, each containing a category of tutorials |
67+
68+
### `Tab`
69+
70+
| Property | Type | Required | Description |
71+
| -------- | ---------------- | -------- | -------------------------------------------------------- |
72+
| `name` | `string` | Yes | The label displayed on the tab (e.g., "Getting Started") |
73+
| `links` | `TutorialLink[]` | Yes | The list of tutorials to show when this tab is selected |
74+
75+
### `TutorialLink`
76+
77+
| Property | Type | Required | Description |
78+
| ------------- | -------- | -------- | -------------------------------------------- |
79+
| `title` | `string` | Yes | The tutorial's heading |
80+
| `description` | `string` | Yes | A brief explanation of what users will learn |
81+
| `link` | `string` | Yes | The URL path to the tutorial page |
82+
83+
## Components
84+
85+
- **TutorialSection** - Main container with tabs and header
86+
- **TutorialGrid** - Grid layout for tutorial cards
87+
- **TutorialCard** - Individual tutorial card with hover effects

src/components/TutorialSection/TutorialSection.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import { Tabs, TabsContent, TabsList, TabsTrigger, Typography } from "@chainlink
55

66
export interface Tab {
77
name: string
8-
description?: string
98
links: TutorialLink[]
109
}
1110

1211
interface TutorialSectionProps {
1312
tabs: Tab[]
14-
defaultTab?: string
1513
}
1614

1715
export const TutorialSection = ({ tabs }: TutorialSectionProps) => {

0 commit comments

Comments
 (0)