Skip to content

Commit fa5b908

Browse files
committed
Docs: improve landing page
1 parent c83f8f8 commit fa5b908

File tree

5 files changed

+39
-52
lines changed

5 files changed

+39
-52
lines changed

.changeset/rotten-chefs-remember.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fumadocs-ui': patch
3+
---
4+
5+
Fix React 18 compatibility

apps/docs/app/(home)/page.client.tsx

+13-26
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,8 @@ export function WhyInteractive(props: {
158158
}, [active, autoActive, duration, items.length]);
159159

160160
return (
161-
<div
162-
id="why-interactive"
163-
className="mt-8 flex flex-col gap-4 rounded-lg border border-fd-foreground/10 bg-fd-muted/50 p-4 shadow-lg lg:flex-row lg:gap-6 lg:p-6 max-lg:-mx-8"
164-
>
165-
<div className="-mt-1.5 flex flex-row overflow-x-auto max-lg:-mx-4 max-lg:items-center max-lg:px-2 lg:-ml-4 lg:flex-col">
161+
<div id="why-interactive" className="flex flex-col gap-6 md:flex-row">
162+
<div className="flex flex-col mt-1.5 border h-fit">
166163
{items.map((item, i) => (
167164
<button
168165
key={item}
@@ -176,11 +173,10 @@ export function WhyInteractive(props: {
176173
}}
177174
type="button"
178175
className={cn(
179-
'inline-flex flex-col-reverse text-nowrap rounded-lg py-1.5 text-start text-sm font-medium text-fd-muted-foreground transition-colors max-lg:px-2 lg:flex-row',
176+
'inline-flex flex-col text-nowrap py-1.5 text-start text-sm text-fd-muted-foreground font-medium px-2',
180177
i === active
181-
? 'text-primary max-lg:bg-fd-primary/10'
178+
? 'text-fd-primary-foreground bg-fd-primary'
182179
: 'hover:text-fd-accent-foreground/80',
183-
i === active && autoActive ? '' : 'max-lg:pb-2.5 lg:pl-3',
184180
)}
185181
onClick={() => {
186182
if (active === i) setAutoActive((prev) => !prev);
@@ -190,16 +186,17 @@ export function WhyInteractive(props: {
190186
}
191187
}}
192188
>
189+
{item}
193190
{i === active && autoActive ? (
194191
<div
195-
className="animate-[why-interactive-x] rounded-lg bg-fd-primary max-lg:h-1 lg:mr-2 lg:w-1 lg:animate-[why-interactive-y]"
192+
className="animate-[why-interactive-x] bg-fd-primary-foreground h-1"
196193
style={{
197194
animationDuration: `${duration.toString()}ms`,
195+
animationTimingFunction: 'linear',
198196
animationFillMode: 'forwards',
199197
}}
200198
/>
201199
) : null}
202-
{item}
203200
</button>
204201
))}
205202
</div>
@@ -213,23 +210,13 @@ export function WhyInteractive(props: {
213210
to {
214211
width: 100%;
215212
}
216-
}
217-
218-
@keyframes why-interactive-y {
219-
from {
220-
height: 0px;
221-
}
222-
223-
to {
224-
height: 100%;
225-
}
226213
}`}
227214
</style>
228215

229216
<div className="flex-1">
230217
{active === 0 ? (
231218
<WhyPanel>
232-
<h3 className="mb-2 text-lg font-medium">
219+
<h3 className="mb-4 text-lg font-semibold">
233220
Implementing search is difficult, we made it simple.
234221
</h3>
235222
<p>
@@ -260,7 +247,7 @@ export function WhyInteractive(props: {
260247

261248
{active === 1 ? (
262249
<WhyPanel>
263-
<h3 className="mb-2 text-lg font-medium">Tailwind CSS Plugin</h3>
250+
<h3 className="mb-4 text-lg font-semibold">Tailwind CSS Plugin</h3>
264251
<p>
265252
Share the same design system cross the docs and your app with
266253
Tailwind CSS. Works great with <b>Shadcn UI</b>.
@@ -277,7 +264,7 @@ export function WhyInteractive(props: {
277264

278265
{active === 2 ? (
279266
<WhyPanel>
280-
<h3 className="mb-2 text-lg font-medium">
267+
<h3 className="mb-4 text-lg font-semibold">
281268
From the source of truth, never repeat yourself again.
282269
</h3>
283270
<p>
@@ -308,7 +295,7 @@ export function WhyInteractive(props: {
308295
) : null}
309296
{active === 3 ? (
310297
<WhyPanel>
311-
<h3 className="mb-2 text-lg font-medium">
298+
<h3 className="mb-4 text-lg font-semibold">
312299
Interactive docs with React.
313300
</h3>
314301
<p>
@@ -326,7 +313,7 @@ export function WhyInteractive(props: {
326313
) : null}
327314
{active === 4 ? (
328315
<WhyPanel>
329-
<h3 className="mb-2 text-lg font-medium">
316+
<h3 className="mb-4 text-lg font-semibold">
330317
Connect your content and server.
331318
</h3>
332319

@@ -341,7 +328,7 @@ export function WhyInteractive(props: {
341328
) : null}
342329
{active === 5 ? (
343330
<WhyPanel>
344-
<h3 className="mb-2 text-lg font-medium">
331+
<h3 className="mb-4 text-lg font-semibold">
345332
Your own content source, search solution, everything.
346333
</h3>
347334
<p>

apps/docs/app/(home)/page.tsx

+17-18
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,22 @@ export default function Page() {
8989

9090
function Architecture() {
9191
return (
92-
<div className="flex flex-col gap-4 border-x border-t px-8 py-16 md:py-24 lg:flex-row md:px-16">
93-
<div className="shrink-0 flex-1 font-mono text-start">
94-
<p className="px-2 py-1 text-sm bg-fd-primary text-fd-primary-foreground font-medium w-fit mb-4">
92+
<div className="flex flex-col gap-4 border-x border-t px-8 py-16 md:py-24 lg:flex-row md:px-12">
93+
<div className="shrink-0 flex-1 text-start">
94+
<p className="px-2 py-1 text-sm font-mono bg-fd-primary text-fd-primary-foreground font-bold w-fit mb-4">
9595
Designed with Love
9696
</p>
97-
<h2 className="text-xl font-medium mb-4 sm:text-2xl">
97+
<h2 className="text-xl font-semibold mb-4 sm:text-2xl">
9898
One framework to solve three problems.
9999
</h2>
100-
<p className="text-sm text-fd-muted-foreground mb-6">
101-
Fumadocs makes it easy to build beautiful docs, and bring the power to
102-
transform content into data, on Next.js.
100+
<p className="text-fd-muted-foreground mb-6">
101+
Fumadocs makes it easy to build beautiful docs, write content, and
102+
transform content into data on Next.js.
103103
<br />
104-
Every part is handled with love - incredibly flexible and
105-
customisable.
104+
<br />
105+
Every part is handled with love, incredibly flexible and customisable.
106106
</p>
107-
<div className="flex flex-row items-center -mx-4">
107+
<div className="flex flex-row items-center font-mono -mx-4">
108108
<a
109109
href="https://github.com/fuma-nama/fumadocs-basehub"
110110
rel="noreferrer noopener"
@@ -134,10 +134,7 @@ function Architecture() {
134134

135135
async function Why() {
136136
return (
137-
<div className="relative overflow-hidden border-x border-t px-8 py-12 md:p-16 md:min-h-[700px]">
138-
<p className="text-center font-medium text-fd-muted-foreground">
139-
Fumadocs offers a complete toolchain to build and maintain your docs.
140-
</p>
137+
<div className="relative overflow-hidden border-x border-t px-8 py-12 md:py-16 md:min-h-[500px]">
141138
<WhyInteractive
142139
typeTable={
143140
<TypeTable
@@ -459,6 +456,8 @@ function Hero() {
459456
</Link>
460457
<a
461458
href="https://githubbox.com/fuma-nama/fumadocs-ui-template"
459+
target="_blank"
460+
rel="noreferrer noopener"
462461
className={cn(
463462
buttonVariants({
464463
size: 'lg',
@@ -534,15 +533,15 @@ function Introduction(): React.ReactElement {
534533
<div className="grid grid-cols-1 border-r md:grid-cols-2">
535534
<div className="flex flex-col gap-2 border-l border-t px-6 py-12 md:py-16">
536535
<div className={cn(badgeVariants())}>1</div>
537-
<h3 className="text-xl font-bold">Create it.</h3>
536+
<h3 className="text-xl font-semibold">Create it.</h3>
538537
<p className="mb-8 text-fd-muted-foreground">
539538
Initialize a new docs with a command.
540539
</p>
541540
<CreateAppAnimation />
542541
</div>
543542
<div className="flex flex-col gap-2 border-l border-t px-6 py-12 md:py-16">
544543
<div className={cn(badgeVariants())}>2</div>
545-
<h3 className="text-xl font-bold">Write.</h3>
544+
<h3 className="text-xl font-semibold">Write.</h3>
546545
<p className="text-fd-muted-foreground">
547546
Write content, with automation tools & type-safe data validation.
548547
</p>
@@ -567,9 +566,9 @@ Hello World
567566
</Files>
568567
</div>
569568
</div>
570-
<div className="col-span-full flex flex-col items-center gap-2 border-l border-t px-6 py-12 text-center">
569+
<div className="col-span-full flex flex-col items-center gap-2 border-l border-t px-6 py-16 text-center">
571570
<div className={cn(badgeVariants())}>3</div>
572-
<h3 className="text-2xl font-bold">Ship.</h3>
571+
<h3 className="text-2xl font-semibold">Ship.</h3>
573572
<p className="text-fd-muted-foreground">
574573
Deploy your docs easily with Next.js compatible hosting platforms.
575574
</p>

apps/docs/content/docs/ui/index.mdx

+3-5
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,12 @@ will replace the `/docs` page with your `page.tsx`.
255255
Fumadocs is designed with flexibility in mind.
256256

257257
You can use `fumadocs-core` as a headless UI library and bring your own styles.
258-
Fumadocs MDX is also a useful library to handle MDX content in Next.js similar to Content Collections.
259-
260-
It also includes:
258+
Fumadocs MDX is also a useful library to handle MDX content in Next.js. It also includes:
261259

262260
- Many built-in components.
263261
- Typescript Twoslash, OpenAPI, and Math (KaTeX) integrations.
264-
- Fast and optimized by default, 100% built on App Router.
265-
- Use it in an existing Next.js project, without refactoring anything.
262+
- Fast and optimized by default, natively built on App Router.
263+
- Tight integration with Next.js, you can add it to an existing Next.js project easily.
266264

267265
Feel free to open the demo in CodeSandbox, or read [Comparisons](/docs/ui/comparisons) if you're interested.
268266

packages/ui/src/layouts/notebook.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ export function DocsLayout({
111111
{...sidebar}
112112
className={cn(
113113
'md:ps-(--fd-layout-offset)',
114-
navMode === 'top'
115-
? 'bg-transparent *:!pt-0'
116-
: 'md:[--fd-nav-height:0px]',
114+
navMode === 'top' ? 'bg-transparent' : 'md:[--fd-nav-height:0px]',
117115
sidebar.className,
118116
)}
119117
>

0 commit comments

Comments
 (0)