195 Pro components and page blocks

Get Pro

Updated

Follow Button

New

Preview

Customize

Count1284
Unfollow colour
Medium

Installation

npx shadcn@latest add https://uibrik.com/r/follow-button.json
Adds the files to components/uibrik/follow-button and installs @number-flow/react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/follow-button.

Usage

import { FollowButton } from "@/components/uibrik/follow-button/follow-button";​<FollowButton  label="Follow"  followingLabel="Following"  unfollowLabel="Unfollow"  count={1284}  countLabel="followers"  dangerColor="#dc2626"  size="md"  defaultFollowing={false}  // following={false}  // onFollowingChange={(following) => {}}/>

Where to use Follow Button

  • Profiles and creator pages

    The plus folds into a check and the count ticks up, so following feels done without a toast.

    Pairs with Company Card and Hover Card

  • Topics and channels

    Hovering a followed item warns with Unfollow in red, which stops accidental unsubscribes.

  • Suggested people lists

    Each button eases to its new width in place, so a list of suggestions never shifts as you follow.

    Pairs with Team Roster

Props

FollowButton
label
Type string
"Follow"
Label before following.
followingLabel
Type string
"Following"
Label once followed.
unfollowLabel
Type string
"Unfollow"
Shown while hovering a followed button.
count
Type number
1284
Followers besides you, shown beside the button.
countLabel
Type string
"followers"
Word after the count.
dangerColor
Type string
"#dc2626"
Colour of the unfollow warning.
size
Type "sm" | "md" | "lg"
"md"
Height, padding and text size.
defaultFollowing
Type boolean
false
State on mount when uncontrolled.
following / onFollowingChange
Type boolean / (following) => void
–
Controlled state.
className
Type string
–
Classes for the wrapper.