Skip to content

ShowDecision

import { ShowDecision } from '@noodlestan/designer-shows/astro';

Renders the appropriate visualization according to the decision type.

In the following two examples we use the <ShowDecision/> to render both a Color Value decision and a Size Scale decision.

<ShowDecision d="Action Color" size={'s'} viz="bg" />
<ShowDecision d="Sizing Scale" size={'xs'} />
Gg
#9c2e5c
32px
48px
72px
108px

Composes

This component composes a different value and visualization component depending on the decision type.

Refer to the table on Composable Types to learn about the options available.

Props

DecisionProps: store, d and layout

These two mandatory store and d props serve to identify and retrieve the decision.

The optional layout prop controls the flow of items in set/scale decisions and the relative position of the value/viz pair.

ValueProps: value

This prop control whether the value should be shown and how to format it.

Refer to the table on Composable Types to learn which value options are available for each decision type.

VizProps: viz, size, and options

These props control whether the visualization should be shown, which specific visualization to show, and how to customize it.

In the examples below we are rendering a ColorValueDecision with, hiding the value and increasing the size of the color swatch.

<ShowDecision d="Content Background Default Color" />
<ShowDecision d="Content Foreground Default Color" />
#2e2526
A lantern swung from the hunter’s hand, casting long, jagged shadows on the trees. Somewhere deep within the woods, the faint hum of a hidden stream could be heard, weaving its way through roots and stones like a lifeline. The fox paused at the edge of the clearing, its golden eyes reflecting the pale glow of the moon as it surveyed the silent expanse. A cold wind carried the scent of rain and something else—something unfamiliar. The fire crackled softly, a fleeting comfort against the encroaching chill. The tall grass swayed lazily, whispering secrets only the wind could hear. The moon broke through the clouds, revealing a path that had not been there before. A clock chimed in the distance, its sound eerily out of place. Overhead, the stars shimmered like a riddle waiting to be solved. The quick brown fox darted through the underbrush, its ears pricked for danger. At the heart of the forest, where the trees grew taller and closer, a feeling of profound stillness settled, as if time had slowed. The lantern flickered twice. The door creaked open, revealing a covered in dust, filled with forgotten things. The brushes on the side of the road stood by, in expectation. In her hand, she held the map, edges frayed, its markings barely legible in the dim light. The forest seemed alive, each rustle and whisper carrying secrets of ages past, guarded by time itself. They exchanged a glance, unspoken understanding passing between them. The fox ran. The moonlight spilled through the treetops, illuminating a forgotten glade where ancient stones bore inscriptions long worn by time. A new path appeared from nowhere. The horizon shimmered, painted in hues of orange and pink. Beneath the stars, the now world seemed boundless and impossibly quiet. Clouds parted. The sun rose magnificently, announcing a brand new day. The river hummed a tune, weaving a silver thread through the forest. Leaves rustled quietly. Beneath the starry canopy, the air was thick with mystery, the scent of moss and pine mingling with the crispness of the night. A pair of squirrels ran for cover while the fox wrestled the wind. Somewhere in the distance, an owl hooted, its cry echoing in the still night. The old bridge creaked under the weight of footsteps, threatening to give way. From the shadows, a new beginning emerged. A single feather floated to the ground, its edges glinting with an iridescent sheen. The night seemed endless, a tapestry of sounds and shadows, each thread a fragment of a story waiting to be discovered. An owl took off. An old wooden gate creaked in protest as it opened to an unfamiliar visitor. The hunter's breath was visible in the cold night air, his steps deliberate and measured as he followed the faint trail left behind. A twig snapped in two. A low growl came from the darkness, closer than expected. He hesitated, the key heavy in his palm, its purpose still unclear.
#e9d9dd

Refer to the table on Composable Types for details on available visualizations and options.