Skip to content

Installation

The registry copies React components into your project. They render data you supply and do not need a Reflet account or API key.

Prepare your app

  • A React app with shadcn/ui initialized, Tailwind CSS v4 and theme tokens.
  • A working @/lib/utils import that exports cn. The registry installs clsx and tailwind-merge, but does not include a replacement utils file.
  • A client component boundary for event handlers and state. Installed components include their own use client directive.

Install and render

npx shadcn add https://www.reflet.app/r/feedback-sweep-corner.json
"use client";

import {
  SweepCorner, SweepCornerBadge, SweepCornerCard,
  SweepCornerContent, SweepCornerTitle,
} from "@/components/ui/feedback-sweep-corner";

export function FeedbackCard() {
  return (
    <SweepCorner defaultUpvotes={12}>
      <SweepCornerCard>
        <SweepCornerContent>
          <SweepCornerTitle>Add keyboard shortcuts</SweepCornerTitle>
        </SweepCornerContent>
      </SweepCornerCard>
      <SweepCornerBadge />
    </SweepCorner>
  );
}

The command writes components/ui/feedback-sweep-corner.tsx, adds tag color tokens for light and dark themes, and installs motion, @phosphor-icons/react, clsx and tailwind-merge. The milestone track does not need the icon package. Check the CLI's changes if your aliases or component directory differ.

To install the milestone view, use milestone-track-view instead of feedback-sweep-corner in the command. Each component page includes its install command and full source for manual installation.

Missing styling usually means Tailwind is not scanning the installed source or your theme tokens are absent. See theming. A missing cn import means your shadcn utility alias needs fixing.

Connect your data

These are presentational components, not widgets. Fetch your data, pass it as props and implement persistence, loading and error handling in your app. For Reflet data use SDK hooks with RefletProvider, or your own server endpoint. Never put secret API keys in a component.

defaultUpvotes/defaultDownvotes initialize local state once. Repeating a vote removes it; the opposite direction switches it. For persisted data, pass upvotes, downvotes, voteType and onVote. onVote receives the pressed direction; your handler updates all three state props. onVoteChange runs only in local mode. Reflet's public vote endpoint supports upvote toggles, not downvotes; adapt the controls before connecting them.