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

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