Rendyn

Component library

189 components

Product blocks

Snippet

Snippet composes tabs, source text and clipboard controls.

Interactive exampleReact Tailwind CSS

Practical React example

Show equivalent installation commands for a few package managers with an accurate copy button.

Before you copy and paste

Use the composed primitives together under their required provider, where one is present. Copy components/kibo-ui/snippet/index.tsx and its returned support files from the Code tab; preserve the project-relative paths. Install the listed primitives: pnpm dlx shadcn@latest add button tabs.

Listed package dependencies: lucide-react.

Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.

Show equivalent installation commands for a few package managers with an accurate copy button

// Usage adapted from Kibo UI's pinned MIT source.
// Copyright (c) 2023 — Present shadcnblocks. See ./LICENSES.md.
"use client";

import {
  Snippet,
  SnippetCopyButton,
  SnippetHeader,
  SnippetTabsContent,
  SnippetTabsList,
  SnippetTabsTrigger,
} from "@/components/kibo-ui/snippet";
import { BoxIcon, HeartIcon } from "lucide-react";
import { useState } from "react";

const commands = [
  {
    label: "kibo-ui",
    icon: HeartIcon,
    code: "npx kibo-ui@latest add snippet",
  },
  {
    label: "shadcn",
    icon: BoxIcon,
    code: "npx shadcn@latest add https://www.kibo-ui.com/r/snippet.json",
  },
];

const Example = () => {
  const [value, setValue] = useState(commands[0].label);
  const activeCommand = commands.find((command) => command.label === value);

  return (
    <Snippet onValueChange={setValue} value={value}>
      <SnippetHeader>
        <SnippetTabsList>
          {commands.map((command) => (
            <SnippetTabsTrigger key={command.label} value={command.label}>
              <command.icon size={14} />
              <span>{command.label}</span>
            </SnippetTabsTrigger>
          ))}
        </SnippetTabsList>
        {activeCommand && (
          <SnippetCopyButton
            onCopy={() =>
              console.log(`Copied "${activeCommand.code}" to clipboard`)
            }
            onError={() =>
              console.error(
                `Failed to copy "${activeCommand.code}" to clipboard`
              )
            }
            value={activeCommand.code}
          />
        )}
      </SnippetHeader>
      {commands.map((command) => (
        <SnippetTabsContent key={command.label} value={command.label}>
          {command.code}
        </SnippetTabsContent>
      ))}
    </Snippet>
  );
};

export default Example;

Usage example adapted from Kibo UI's pinned MIT source. Retain the source licence notices when copying.

Keep each tab’s visible command and copy value identical. Use package versions and flags appropriate to the actual project rather than copying a screenshot’s command blindly.

Customization

SnippetCopyButtonProps.value
Required; string.
SnippetCopyButtonProps.onCopy
Optional; () => void.
SnippetCopyButtonProps.onError
Optional; (error: Error) => void.
SnippetCopyButtonProps.timeout
Optional; number.

Integration notes

  • The component displays commands and does not run them.
  • Handle clipboard failure and keep commands selectable with the keyboard.

Component source: Kibo UI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.

Better with your agent

Give your agent taste.

The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.

All components are free. Sign up only to connect MCP.

Connect to MCP