();
+ const handleSubmit = useCallback(({ selectedValues }: QuestionResponse) => {
+ setAnswer(selectedValues);
+ }, []);
+
+ if (answer) {
+ return (
+
+ Selected:
+ {answer.join(", ")}
+
+ );
+ }
+
+ return (
+
+
+ Which features should we include?
+ Select all that apply.
+
+
+ Authentication
+ Database
+ Payments
+
+
+ Continue
+
+
+ );
+};
+
+export default Example;
diff --git a/packages/examples/src/question-single-select.tsx b/packages/examples/src/question-single-select.tsx
new file mode 100644
index 00000000..204fe32a
--- /dev/null
+++ b/packages/examples/src/question-single-select.tsx
@@ -0,0 +1,49 @@
+"use client";
+
+import type { QuestionResponse } from "@repo/elements/question";
+
+import {
+ Question,
+ QuestionActions,
+ QuestionDescription,
+ QuestionOption,
+ QuestionOptions,
+ QuestionPrompt,
+ QuestionSubmit,
+} from "@repo/elements/question";
+import { useCallback, useState } from "react";
+
+const Example = () => {
+ const [answer, setAnswer] = useState();
+ const handleSubmit = useCallback(({ selectedValues }: QuestionResponse) => {
+ setAnswer(selectedValues[0]);
+ }, []);
+
+ if (answer) {
+ return (
+
+ Selected:
+ {answer}
+
+ );
+ }
+
+ return (
+
+
+ Which framework should we use?
+ Select one option.
+
+
+ Next.js
+ Nuxt
+ SvelteKit
+
+
+ Continue
+
+
+ );
+};
+
+export default Example;
diff --git a/packages/examples/src/question.tsx b/packages/examples/src/question.tsx
new file mode 100644
index 00000000..54702032
--- /dev/null
+++ b/packages/examples/src/question.tsx
@@ -0,0 +1,60 @@
+"use client";
+
+import type { QuestionResponse } from "@repo/elements/question";
+
+import {
+ Question,
+ QuestionActions,
+ QuestionDescription,
+ QuestionInput,
+ QuestionOption,
+ QuestionOptions,
+ QuestionPrompt,
+ QuestionSubmit,
+} from "@repo/elements/question";
+import { useState } from "react";
+
+const Example = () => {
+ const [response, setResponse] = useState();
+
+ if (response) {
+ const selected = response.selectedValues.join(", ");
+ const summary = [selected, response.text].filter(Boolean).join(" — ");
+
+ return (
+
+ Answered:
+ {summary}
+
+ );
+ }
+
+ return (
+
+
+ What should the project include?
+
+ Choose any features and add details if needed.
+
+
+
+ Authentication
+ Database
+ Payments
+
+
+
+ Answer
+
+
+ );
+};
+
+export default Example;