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

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