BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/stackzero/review-03-block

review-03-block

stackzero/review-03-block
FreeBlock

stackzero publishes no description for this item.

Install it

npx shadcn@latest add https://ui.stackzero.co/r/review-03-block.json

Source

/components/commerce-ui/blocks/reviews/review-03.tsxui.stackzero.co/r/review-03-block.json
1"use client";
2
3import LikeRating from "@/components/commerce-ui/like-rating-basic";
4import StarRating from "@/components/commerce-ui/star-rating-basic";
5import { Button } from "@/components/ui/button";
6import { useState, useRef, useEffect } from "react";
7
8interface Review_03Props {
9 defaultRating?: number;
10 reviewerName?: string;
11 reviewerTitle?: string;
12 reviewerAvatar?: string;
13 initialLikes?: number;
14 initialDislikes?: number;
15 initialIsLiked?: boolean;
16 initialIsDisliked?: boolean;
17 reviewTitle?: string;
18 reviewContent?: string;
19}
20
21function Review_03({
22 defaultRating = 5,
23 initialDislikes = 1,
24 initialIsDisliked = false,
25 initialIsLiked = true,
26 initialLikes = 11,
27 reviewContent = "I recently got my hands on this amazing bag, and after using it for a while, I can confidently say it is a solid choice for travelling. Verdict: If you are looking for an amazing backpack that balances comfort, organization, and durability, this is a great investment. Would definitely recommend it to anyone in need of a reliable bag! 🎒💼",
28 reviewerAvatar = "https://raw.githubusercontent.com/stackzero-labs/ui/refs/heads/main/public/placeholders/user-07.jpg",
29 reviewerName = "Adam Smith",
30 reviewerTitle = "CEO ACME Inc.",
31 reviewTitle = "Wished I bought this thing sooner!!",
32}: Review_03Props = {}) {
33 const [isExpanded, setIsExpanded] = useState(false);
34 const [likes, setLikes] = useState(initialLikes);
35 const [dislikes, setDislikes] = useState(initialDislikes);
36 const [isLiked, setIsLiked] = useState(initialIsLiked);
37 const [isDisliked, setIsDisliked] = useState(initialIsDisliked);
38 const [isContentOverflowing, setIsContentOverflowing] = useState(false);
39 const contentRef = useRef<HTMLParagraphElement>(null);
40
41 // Check if content overflows when component mounts or content changes
42 useEffect(() => {
43 const checkOverflow = () => {
44 if (contentRef.current) {
45 // Check if scrollHeight is greater than clientHeight
46 const isOverflowing =
47 contentRef.current.scrollHeight > contentRef.current.clientHeight;
48 setIsContentOverflowing(isOverflowing);
49 }
50 };
51
52 // Run the check after render
53 checkOverflow();
54
55 // Also check on window resize in case layout changes
56 window.addEventListener("resize", checkOverflow);
57 return () => window.removeEventListener("resize", checkOverflow);
58 }, [reviewContent]);
59 return (
60// … truncated

What it pulls in

Other registry items

  • button
  • https://ui.stackzero.co/r/star-rating-basic.json
  • https://ui.stackzero.co/r/like-rating-basic.json

Files it writes

  • @/components/commerce-ui/blocks/reviews/review-03.tsx

Facts

Registry
stackzero
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

ui.stackzero.co stackzero-labs/ui on GitHub Raw registry item This item as JSON

More from stackzero

All 112 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
address-01-blockaddress-01-blockstackzeroBlocksFree4 deps
address-02-blockaddress-02-blockstackzeroBlocksFree4 deps
address-03-blockaddress-03-blockstackzeroBlocksFree4 deps
banner-01-blockbanner-01-blockstackzeroBlocksFreeno deps
banner-02-blockbanner-02-blockstackzeroBlocksFreeno deps
banner-03-blockbanner-03-blockstackzeroBlocksFreeno deps
banner-04-blockbanner-04-blockstackzeroBlocksFreeno deps
banner-05-blockbanner-05-blockstackzeroBlocksFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex