Skip to content

Commit c826c70

Browse files
authored
[chore]: add slider example that displays current value (#34399)
1 parent 14cd5d5 commit c826c70

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/web-components/src/slider/slider.stories.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { html } from '@microsoft/fast-element';
1+
import { html, ref } from '@microsoft/fast-element';
22
import { type Meta, renderComponent, type StoryArgs, type StoryObj } from '../helpers.stories.js';
33
import { SliderOrientation as SliderSetOrientation, SliderSize as SliderSetSize } from './slider.options.js';
44
import type { Slider as FluentSlider } from './slider.js';
@@ -100,6 +100,18 @@ export const MediumSize: Story = {
100100
},
101101
};
102102

103+
export const SliderWithValue: Story = {
104+
render: renderComponent(html`
105+
<fluent-field label-position="above">
106+
<label slot="label" for="slider-in-field">Slider value</label>
107+
<fluent-slider slot="input" id="slider-in-field" ${ref('slider')}></fluent-slider>
108+
<fluent-text slot="message" size="200">
109+
Current value: <output :value="${x => x.slider.value}"></output>
110+
</fluent-text>
111+
</fluent-field>
112+
`),
113+
};
114+
103115
export const MinMax: Story = {
104116
args: {
105117
// @ts-expect-error Slider attrs are typed as strings??

0 commit comments

Comments
 (0)