Skip to content

Sweep corner

A composable feedback card with a corner vote badge. Votes stay in React state until your app persists them.

Preview

Add keyboard shortcuts for common actions

UXFeature
7 comments3 days ago
21 net votes

Installation

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

Usage

import {
  SweepCorner, SweepCornerBadge, SweepCornerCard, SweepCornerContent,
  SweepCornerFooter, SweepCornerTag, SweepCornerTags, SweepCornerTitle,
} from "@/components/ui/feedback-sweep-corner";
<SweepCorner defaultUpvotes={24} defaultDownvotes={3}>
  <SweepCornerCard>
    <SweepCornerContent>
      <SweepCornerTitle>
        Add keyboard shortcuts for common actions
      </SweepCornerTitle>
      <SweepCornerTags>
        <SweepCornerTag color="purple">UX</SweepCornerTag>
        <SweepCornerTag color="green">Feature</SweepCornerTag>
      </SweepCornerTags>
    </SweepCornerContent>
    <SweepCornerFooter comments={7} time="3 days ago" />
  </SweepCornerCard>
  <SweepCornerBadge />
</SweepCorner>

Behavior and limits

  • The badge shows net votes. The footer shows separate totals and upvote share, with 50% when there are no votes.
  • Title onClick creates a card-wide button overlay. Keep additional controls clear of the overlay, and never wrap vote buttons in another button.

API reference

SweepCorner

Required vote context and positioned wrapper. Accepts children and className.

SweepCornerCard

Card surface. Accepts children and className.

SweepCornerContent

Content region with room reserved for the corner badge. Accepts children and className.

SweepCornerTitle

h3 heading. Accepts children and className; adjust the installed heading if your page hierarchy needs another level.

SweepCornerTags

Wrapping tag row. Accepts children and className.

SweepCornerTag

Tag pill. Accepts children and className.

SweepCornerBadge

Context-bound vote buttons and net count. Takes no props; must be inside SweepCorner.

SweepCornerFooter

Context-bound totals, comments and time. Accepts className.

Check the installed source for each component's className and HTML props. Vote controls do not accept arbitrary HTML props.