Answer

An answer is anything that responds to a question, request, action, etc. Examples include FAQ replies, quiz answers, survey responses, and forum replies.

This headless component renders a <div> with class answer. The consumer supplies the answer content as children.

Props

  • label: string (optional) -- accessible label for the answer
  • children: slot (required) -- answer content (body, citations, related links, action buttons)
  • ...restProps: Any additional HTML attributes

ARIA

  • aria-label -- describes the answer for screen readers when no visible heading is present

When to Use

  • Use to pair with a question for FAQ and Q&A patterns.
  • Use for quiz answer reveals or feedback panels.
  • Use for forum replies displayed beneath the original question.

Related components

  • question — a question is anything that asks for information, invites a response, tests knowledge, etc.
  • comment — a comment is anything that expresses an opinion, observation, explanation, etc.

Example

The clinic opens at 8:00 a.m. on weekdays.

Show Svelte source
// In your Svelte component:
import Answer from "lily-design-system-svelte-headless/components/Answer/Answer.svelte";

<Answer>
  <!-- content -->
</Answer>