Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ const data: ReferenceEntityTemplateSchema = {
],
},
},
{
description:
'Compose rich choice content by nesting other components within `Choice` elements. This example demonstrates combining images, text, and layout components to create visually enhanced choice options with descriptions and supporting images.',
codeblock: {
title: 'Compose rich choice content',
tabs: [
{
code: './examples/composed-choices.jsx',
language: 'jsx',
},
],
},
},
],
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<s-choice-list>
{/* Composed choice with image and text */}
<s-choice value="option1">
<s-stack gap="small-200" alignItems="center" direction="inline">
<s-box blockSize="40px" inlineSize="40px">
<s-image src="https://placehold.co/60x60" inlineSize="fill" objectFit="cover" />
</s-box>
<s-box>
<s-text>Option 1</s-text>
<s-text type="small" color="subdued">
Additional details for option 1
</s-text>
</s-box>
</s-stack>
</s-choice>

{/* Composed choice with nested text */}
<s-choice value="option2">
<s-text type="strong">
Option 2
<s-text type="small" color="subdued">
Additional details for option 2
</s-text>
</s-text>
</s-choice>

{/* Mix of text and composed elements */}
<s-choice value="option3" disabled>
Option 3
<s-text type="small" color="subdued">
(disabled)
</s-text>
<s-text type="strong">Additional details for option 3</s-text>
</s-choice>
</s-choice-list>