Sweep corner
A composable feedback card with a corner vote badge. Votes stay in React state until your app persists them.
Preview
Installation
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
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.
SweepCornerBadge
Context-bound vote buttons and net count. Takes no props; must be inside SweepCorner.
Check the installed source for each component's className and HTML props. Vote controls do not accept arbitrary HTML props.