Skip to content

Commit

Permalink
Feat/#3202 svelte slider snippet with argument (#3205)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Simmons <[email protected]>
  • Loading branch information
Akkretion and endigo9740 authored Feb 10, 2025
1 parent 936df1b commit 461d9de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-toys-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@skeletonlabs/skeleton-svelte': patch
---

feat: Make Svelte Slider marker snippet take the marker value as argument to enable marker customization
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<!-- Mark -->
<span {...api.getMarkerProps({ value })} class="{markBase} {markText} {markOpacity} {markClasses}" data-testid="slider-mark">
{#if mark}
{@render mark()}
{@render mark(value)}
{:else}
{value}
{/if}
Expand Down
4 changes: 2 additions & 2 deletions packages/skeleton-svelte/src/lib/components/Slider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ export interface SliderProps extends Omit<slider.Context, 'id' | 'thumbSize'> {
stateReadOnly?: string;

// Children
/** Replace numeric markers with symbol, such as a icon. */
mark?: Snippet;
/** Replace numeric markers with symbol, such as a icon. Takes marker value as argument. */
mark?: Snippet<[number]>;
}

0 comments on commit 461d9de

Please sign in to comment.