SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

DocsFeedback

The quiet "Was this helpful?" closing a docs page, as a plain form that posts without JavaScript.

Was this page helpful?

Thanks for the feedback.

View code
tsx
<DocsFeedback
	action="/docs/feedback"
	page="/docs/alerts"
	state={sent ? "sent" : "idle"}
	labels={{
		question: "Was this page helpful?",
		yes: "Yes",
		no: "No",
		note: "Anything we could add? (optional)",
		send: "Send feedback",
		thanks: "Thanks for the feedback.",
	}}
/>

Demo docs sites

Whole pages built only from @sdxc/ui, each for an invented product with its own palette and type. They open in a new tab.

Every demo, landings and docs sites alike, is listed in the demo gallery.

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { DocsFeedback } from "@sdxc/ui/docs";

Renders the vote form, or the thank-you once state is sent. The form posts helpful=yes|no, page and an optional note to action; the thank-you is a live status so a reader on a screen reader hears it after an enhanced submit.

Examples

tsx
<DocsFeedback frame="feedback" resetScroll="manual" action="/docs/feedback" page="/docs/alerts" labels={labels} />

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
actionstringYesURL the form posts to.
pagestringYesIdentifier of the page, posted in the page field; usually its path.
labelsLabelsYes
state"idle" | "sent"No
framestringNoThe named frame the vote reloads (data-rmx-target), so a page that renders this block inside <Frame name> swaps in the thank-you without reloading the page.
resetScroll"manual" | "after-transition"No"manual" keeps the reader where they are when the vote's response renders, instead of the scroll reset a navigation does by default (data-rmx-reset-scroll).

Also accepts everything in Omit<TagProps<"div">, "children">.

Types

NameValuesWhat it decides
State"idle" | "sent"idle asks the question; sent thanks the reader in place of the form.
@sdxc/ui

Can’t find it? Contact us