Feedback Card

PreviousNext

A highly interactive rating card with layout morphing animations, emojis, and animated SVG based on the Inset Card UI pattern.

How was your experience?

Your feedback helps us improve

"use client";

import { FeedbackCard } from "@/components/matos-ui/feedback-card";

export function FeedbackCardDemo() {
  return (
    <div className="flex w-full items-center justify-center p-8">
      <FeedbackCard />
    </div>
  );
}

Installation

pnpm dlx shadcn@latest add https://matos-ui.com/r/feedback-card.json

Usage

import { FeedbackCard } from '@/components/matos-ui/feedback-card'
<FeedbackCard
  onSubmit={data => {
    console.log('Selected rating:', data.rating)
    console.log('Optional message:', data.message)
  }}
/>

Props

PropTypeDefaultDescription
titlestring"How was your experience?"Title in the initial state.
subtitlestring"Your feedback helps us improve"Subtitle in the initial state.
optionsFeedbackOption[]Internal defaultOptions with emoji faces, labels and values.
onSubmit(data) => voidCalled when the user clicks "Submit feedback".
successTitlestring"Thanks for your feedback!"Title of the success panel.
successDescriptionstring"Your rating was sent successfully."Description of the final panel.
size"sm" | "md" | "lg""md"Sets the maximum width of the component.

Fluid Transitions (Morphing)

This component uses Framer Motion's layout prop to achieve seamless transitions between each step. No DOM mounting happens abruptly — everything is driven by a spring animation.

  • The selected emoji naturally migrates to the top of the card (layoutId) via a subtle shared element transition.
  • The final SVG checkmark draws itself using the pathLength animation from the Framer Motion engine.