tinkerers-labs

Feedback Widget

Forms

About

A button in the corner that opens into a small form: how it is going, a message, and Send. A failed send keeps the text.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Feedback Widget to your project and fits it to your theme.

Code

How Feedback Widget is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import * as React from "react"

import {
  FeedbackWidget,
  type FeedbackWidgetValue,
} from "@/components/ui/mischief-feedback-widget"

export default function FeedbackWidgetDemo() {
  const [fail, setFail] = React.useState(false)
  const [last, setLast] = React.useState<FeedbackWidgetValue | null>(null)

  return (
    <div className="bg-background border-border relative flex min-h-[30rem] w-full max-w-[34rem] flex-col gap-4 overflow-hidden rounded-[1.25rem] border p-6 shadow-sm">
      <div>
        <h3 className="text-sm font-semibold">Billing settings</h3>
        <p className="text-muted-foreground mt-1 text-sm">
          The feedback button sits in the corner of the page. Open it, pick a
          face, and write a line.
        </p>
      </div>

      <label className="text-muted-foreground flex items-center gap-2.5 text-xs">
        <input
          checked={fail}
          className="accent-destructive size-3.5"
          onChange={(event) => setFail(event.target.checked)}
          type="checkbox"
        />
        Make the next send fail
      </label>

      {last ? (
        <p className="text-muted-foreground text-xs">
          Last sent: {last.sentiment ?? "no sentiment"}
          {last.message ? `, "${last.message}"` : ""}
        </p>
      ) : null}

      <FeedbackWidget
        className="absolute"
        onSubmit={async (value) => {
          await new Promise((resolve) => setTimeout(resolve, 900))
          if (fail) throw new Error("The feedback service did not answer.")
          setLast(value)
        }}
      />
    </div>
  )
}

More by tinkerers-labs

View all
  • Prompt Input

    Prompt Input

    11
  • Burst

    Burst

    4
  • Quantity Button

    Quantity Button

    1
  • Undo Button

    Undo Button

  • Tool Approval

    Tool Approval

  • Notification Stack

    Notification Stack

  • Swipe Actions

    Swipe Actions

  • Sparkline

    Sparkline

More in Forms

View all
  • Form

    Form

    7
  • Login 2

    Login 2

    16
  • Contact Form

    Contact Form

    33
  • Contact Card

    Contact Card

    1.1K
  • Book A Demo 1

    Book A Demo 1

    95
  • Premium Auth

    Premium Auth

    614
  • Onboarding Stepper

    Onboarding Stepper

    13
  • Authentication Card

    Authentication Card

    52