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 Space Scale decision.

<ShowDecision d="Action Color" size={'s'} viz="bg" />
<ShowDecision d="Sizing Space 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
The fox ran. A new path appeared from nowhere. The moonlight spilled through the treetops, illuminating a forgotten glade where ancient stones bore inscriptions long worn by time. The moon broke through the clouds, revealing a path that had not been there before. They exchanged a glance, unspoken understanding passing between them. 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 river hummed a tune, weaving a silver thread through the forest. 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. The night seemed endless, a tapestry of sounds and shadows, each thread a fragment of a story waiting to be discovered. Somewhere in the distance, an owl hooted, its cry echoing in the still night. An owl took off. The old bridge creaked under the weight of footsteps, threatening to give way. A cold wind carried the scent of rain and something else—something unfamiliar. He hesitated, the key heavy in his palm, its purpose still unclear. 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 quick brown fox darted through the underbrush, its ears pricked for danger. A twig snapped in two. 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 fire crackled softly, a fleeting comfort against the encroaching chill. From the shadows, a new beginning emerged. The door creaked open, revealing a covered in dust, filled with forgotten things. 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. A low growl came from the darkness, closer than expected. Beneath the stars, the now world seemed boundless and impossibly quiet. The horizon shimmered, painted in hues of orange and pink. An old wooden gate creaked in protest as it opened to an unfamiliar visitor. In her hand, she held the map, edges frayed, its markings barely legible in the dim light. A single feather floated to the ground, its edges glinting with an iridescent sheen. 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. Leaves rustled quietly. The forest seemed alive, each rustle and whisper carrying secrets of ages past, guarded by time itself. Overhead, the stars shimmered like a riddle waiting to be solved. The sun rose magnificently, announcing a brand new day. Clouds parted. The lantern flickered twice. A clock chimed in the distance, its sound eerily out of place.
#e9d9dd

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