···11+import { Callout } from "nextra/components";
22+13# Public Status Widget
2435We have added a public endpoint where you can access the status of your status
···79```bash
810curl https://api.openstatus.dev/public/status/:slug
911```
1212+1313+<Callout type="info">
1414+ We have released an `@openstatus/react` npm package that allows you to easily
1515+ integrate the pre-typed status into your React projects or use the default
1616+ widget. Read more [here](/packages/react).
1717+</Callout>
10181119The response is a JSON object with the following structure:
1220
···11+## React Server Component
22+33+```tsx
44+import { StatusWidget } from "@openstatus/react";
55+66+export function Page() {
77+ return <StatusWidget slug="status" />;
88+}
99+```
1010+1111+It will automatically attach the slug to the href to allow the user to open a
1212+new tab on click to `https://slug.openstatus.dev`. If you want to redirect him
1313+to a specific page, use the `href` property, like so:
1414+1515+```tsx
1616+<StatusWidget slug="documenso" href="https://status.documenso.com" />
1717+```
1818+1919+> `StatusWidget` is an **async function** and will only work with RSC. Using it
2020+> within a dead simple React App will not work.
2121+2222+### Styling
2323+2424+#### With tailwindcss
2525+2626+```ts
2727+// tailwind.config.js
2828+module.exports = {
2929+ content: [
3030+ "./app/**/*.{tsx,ts,mdx,md}",
3131+ "./node_modules/@openstatus/react/**/*.{js,ts,jsx,tsx}",
3232+ ],
3333+ theme: {
3434+ extend: {},
3535+ },
3636+ plugins: [],
3737+};
3838+```
3939+4040+#### Without tailwindcss
4141+4242+```tsx
4343+// app/layout.tsx
4444+import "@openstatus/react/dist/styles.css";
4545+```
4646+4747+## Typed fetch function
4848+4949+```tsx
5050+import { getStatus } from "@openstatus/react";
5151+5252+// React Server Component
5353+async function CustomStatusWidget() {
5454+ const res = await getStatus("slug");
5555+ // ^StatusResponse = { status: Status }
5656+5757+ const { status } = res;
5858+ // ^Status = "unknown" | "operational" | "degraded_performance" | "partial_outage" | "major_outage" | "under_maintenance"
5959+6060+ return <div>{/* customize */}</div>;
6161+}
6262+```
6363+6464+[Link to npm](https://www.npmjs.com/package/@openstatus/react)
···11import Link from "next/link";
22import { ArrowUpRight } from "lucide-react";
3344-import { StatusWidget } from "@/components/status-widget";
44+import { StatusWidget } from "@openstatus/react";
55+56import { cn } from "@/lib/utils";
67import { Shell } from "../dashboard/shell";
78