Standalone search widget
The @fern-api/search-widget package provides a standalone React component that brings Ask Fern’s AI-powered search to any React application outside of your Fern Docs site. Embed a search modal in your dashboard, marketing site, or internal tool so users can find relevant documentation without leaving their workflow.
Search widget embedded in a dashboard. Try the live demo or browse the demo source.
Prerequisites
- React 19 — all other dependencies are bundled.
- A live, cloud-hosted Fern Docs site with Ask Fern enabled — the widget connects to your published docs site at runtime. Self-hosted and local preview environments aren’t supported.
- Public documentation — the widget only supports public docs. If your site uses authentication, the widget will only return unauthenticated results.
Getting started
Properties
All standard HTML button attributes are also supported and forwarded to the trigger button.
The URL of your published Fern Docs site (for example, https://docs.example.com).
Language code for the search interface.
Icon element to display in the button.
CSS class names for the trigger button.
Inline styles for the trigger button.
Button content (text, icons, etc.).
Disables the button.
Additional click handler that runs before the modal opens.