mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 03:49:34 +00:00
feat(slider): add fullWidth prop
This commit is contained in:
parent
35031e800c
commit
ecc4e521bb
1 changed files with 10 additions and 1 deletions
|
@ -35,6 +35,12 @@
|
||||||
/** Set to `true` to hide the text input */
|
/** Set to `true` to hide the text input */
|
||||||
export let hideTextInput = false;
|
export let hideTextInput = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` for the slider to span
|
||||||
|
* the full width of its containing element.
|
||||||
|
*/
|
||||||
|
export let fullWidth = false;
|
||||||
|
|
||||||
/** Set an id for the slider div element */
|
/** Set an id for the slider div element */
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
|
@ -143,7 +149,10 @@
|
||||||
{labelText}
|
{labelText}
|
||||||
</slot>
|
</slot>
|
||||||
</label>
|
</label>
|
||||||
<div class:bx--slider-container="{true}">
|
<div
|
||||||
|
class:bx--slider-container="{true}"
|
||||||
|
style="{fullWidth ? 'width: 100%' : undefined}"
|
||||||
|
>
|
||||||
<span class:bx--slider__range-label="{true}">{minLabel || min}</span>
|
<span class:bx--slider__range-label="{true}">{minLabel || min}</span>
|
||||||
<div
|
<div
|
||||||
bind:this="{ref}"
|
bind:this="{ref}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue