+ {/* Grow the block to fill the grid cell so both columns share a height;
+ *:mb-0 drops CodeBlock's own bottom margin. These snippets render
+ without a language icon, so hide the (empty) header icon slot to keep
+ the filename flush with the header padding. */}
+
+ {rendered}
-
- {caption}
-
+ {caption}
);
};
diff --git a/apps/docs/app/[lang]/home/[code]/install-command.tsx b/apps/docs/app/[lang]/home/[code]/install-command.tsx
index 17fb6a03..4b721aab 100644
--- a/apps/docs/app/[lang]/home/[code]/install-command.tsx
+++ b/apps/docs/app/[lang]/home/[code]/install-command.tsx
@@ -1,7 +1,5 @@
'use client';
-import { useRouter } from 'next/navigation';
-import { useState } from 'react';
import {
CommandPromptContent,
CommandPromptCopy,
@@ -12,7 +10,8 @@ import {
CommandPromptTrigger,
CommandPromptTriggerDivider,
CommandPromptViewport,
-} from '@/components/ui/command-prompt';
+} from '@vercel/geistdocs/components/command-prompt';
+import { useState } from 'react';
const COMMAND_FOR_HUMANS = 'npm install flags';
const COMMAND_FOR_AGENTS = 'npx skills add vercel/flags@flags-sdk';
@@ -26,9 +25,12 @@ interface InstallCommandProps {
}
export const InstallCommand = ({ value, flagKey }: InstallCommandProps) => {
- const router = useRouter();
- // Optimistic override so the tab updates instantly; the server render of the
- // matching prebuilt `[code]` takes over on refresh.
+ // The optimistic override drives the UI instantly and the cookie persists the
+ // choice for the next load (the server reads it and renders the matching
+ // prebuilt `[code]`). We intentionally do NOT call router.refresh() here:
+ // this flag's only consumer is this switcher, so a refresh changes nothing
+ // visible, but it remounts the subtree mid-toggle and kills the command-line
+ // width animation.
const [override, setOverride] = useState(null);
const current = override ?? value;
@@ -40,7 +42,6 @@ export const InstallCommand = ({ value, flagKey }: InstallCommandProps) => {
if (nextValue === current) return;
document.cookie = `${flagKey}=${nextValue}; max-age=${oneYearInSeconds}; path=/`;
setOverride(nextValue);
- router.refresh();
}}
value={current}
>
diff --git a/apps/docs/app/[lang]/home/[code]/layout.tsx b/apps/docs/app/[lang]/home/[code]/layout.tsx
index b60afad2..10ce2457 100644
--- a/apps/docs/app/[lang]/home/[code]/layout.tsx
+++ b/apps/docs/app/[lang]/home/[code]/layout.tsx
@@ -11,7 +11,7 @@ export default async function Layout({
return (
<>
{bannerFlag ? (
-
+
Flags SDK is the simplest way to use feature flags in Next.js and
SvelteKit.
diff --git a/apps/docs/app/[lang]/home/[code]/page.tsx b/apps/docs/app/[lang]/home/[code]/page.tsx
index 3c0597fa..8cc85f18 100644
--- a/apps/docs/app/[lang]/home/[code]/page.tsx
+++ b/apps/docs/app/[lang]/home/[code]/page.tsx
@@ -1,9 +1,9 @@
+import { Button } from '@vercel/geistdocs/components/button';
import { generatePermutations } from 'flags/next';
import { FlagValues } from 'flags/react';
import { ArrowRight } from 'lucide-react';
import type { Metadata } from 'next';
import Link from 'next/link';
-import { Button } from '@/components/ui/button';
import {
enableBannerFlag,
enableDitheredHeroFlag,
@@ -98,7 +98,7 @@ export default async function HomePage({
{heroTextFlag}
-
+
Flags SDK is a free, open-source library for using feature flags in
Next.js and SvelteKit.
@@ -110,12 +110,12 @@ export default async function HomePage({
{ditheredHeroFlag ? : null}
-
+
Try the Flags SDK
-
+
Set persistent flags for this page
@@ -153,7 +153,7 @@ export default async function HomePage({
Using flags as code
-
+
The SDK sits between your application and the source of your
flags, helping you follow best practices and keep your website
fast.
@@ -168,7 +168,7 @@ export default async function HomePage({
{feature.title}
-
+
{feature.description}
@@ -183,7 +183,7 @@ export default async function HomePage({
Effortless setup
-
+
With a simple declarative API to define and use your feature
flags.