carbon-components-svelte/tests/Slider.test.svelte
metonym 1ccdf64504
feat(slider): add fullWidth prop (#1354)
The `bx--slider` class in the `Slider` component has max-width of `40rem`. Because `$$restProps` is spread to the top-level `div` element in `Slider`, the only way to override the style is to do so globally:

```css
:global(.bx--slider-container) {
  width: 100%;
}

:global(.bx--slider) {
  max-width: none;
}
```

This adds a `fullWidth` prop that sets a full width style using inline style attributes.
2022-06-18 12:47:10 -07:00

37 lines
519 B
Svelte

<script lang="ts">
import { Slider, SliderSkeleton } from "../types";
</script>
<Slider />
<Slider
labelText="Runtime memory (MB)"
min="{10}"
max="{990}"
maxLabel="990 MB"
value="{100}"
fullWidth
/>
<Slider
labelText="Runtime memory (MB)"
min="{10}"
max="{990}"
maxLabel="990 MB"
value="{100}"
step="{10}"
/>
<Slider
light
labelText="Runtime memory (MB)"
min="{10}"
max="{990}"
maxLabel="990 MB"
value="{100}"
step="{10}"
/>
<SliderSkeleton />
<SliderSkeleton hideLabel />