Docs feedback widget
Docs feedback widget
How this was built
How this was built
This is a real React component, declared inline right in the MDX file with
export const FeedbackWidget = () => {...}. Mintlify pre-injects hooks like useState into MDX — no import needed, and no separate /snippets/ file required for a component this small.Clicking a thumb sets feedback to "yes" or "no", which swaps the rendered JSX from the prompt to a confirmation view. The checkmark is an inline SVG whose circle and check mark draw themselves in with stroke-dasharray / stroke-dashoffset animations, defined in custom.css.Animated stat counter
Animated stat counter
How this was built
How this was built
StatCounter uses useRef to grab its own DOM node, then a useEffect sets up an IntersectionObserver watching that node. The first time it becomes at least 30% visible, a requestAnimationFrame loop runs for duration milliseconds, easing the displayed number from 0 up to value with an ease-out-cubic curve (1 - (1 - progress) ** 3) and writing each frame to state with setDisplay. A started ref guards against re-triggering if the counter scrolls in and out of view again.Using IntersectionObserver instead of a raw scroll listener means it fires correctly even when the counter starts hidden inside a collapsed Accordion — the count-up plays the moment you open this section, same as it would scrolling down a normal page.