sl-alert

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-icon-button': SlIconButton } - - - true
base
{ "text": "HTMLElement" }
- - - - -
open
{ "text": "boolean" }
falseIndicates whether or not the alert is open. You can toggle this attribute to show and hide the alert, or you can use the `show()` and `hide()` methods and this attribute will reflect the alert's open state.opentrue -
closable
{ "text": "boolean" }
falseEnables a close button that allows the user to dismiss the alert.closabletrue -
variant
{ "text": "'primary' | 'success' | 'neutral' | 'warning' | 'danger'" }
'primary'The alert's theme variant.varianttrue -
duration - InfinityThe length of time, in milliseconds, the alert will show before closing itself. If the user interacts with the alert before it closes (e.g. moves the mouse over it), the timer will restart. Defaults to `Infinity`, meaning the alert will not close on its own.duration - -
Attributes
namedefaultdescriptionfieldNametyperesolveInitializer
openfalseIndicates whether or not the alert is open. You can toggle this attribute to show and hide the alert, or you can use the `show()` and `hide()` methods and this attribute will reflect the alert's open state.open
{ "text": "boolean" }
-
closablefalseEnables a close button that allows the user to dismiss the alert.closable
{ "text": "boolean" }
-
variant'primary'The alert's theme variant.variant
{ "text": "'primary' | 'success' | 'neutral' | 'warning' | 'danger'" }
-
durationInfinityThe length of time, in milliseconds, the alert will show before closing itself. If the user interacts with the alert before it closes (e.g. moves the mouse over it), the timer will restart. Defaults to `Infinity`, meaning the alert will not close on its own.duration -
{ "module": "src/components/alert/alert.component.ts" }
CSS Parts
namedescription
baseThe component's base wrapper.
iconThe container that wraps the optional icon.
messageThe container that wraps the alert's main content.
close-buttonThe close button, an `<sl-icon-button>`.
close-button__baseThe close button's exported `base` part.
Slots
namedescription
The alert's main content.
iconAn icon to show in the alert. Works best with `<sl-icon>`.
Events
namedescriptionreactNameeventName
sl-showEmitted when the alert opens.onSlShowSlShowEvent
sl-after-showEmitted after the alert opens and all animations are complete.onSlAfterShowSlAfterShowEvent
sl-hideEmitted when the alert closes.onSlHideSlHideEvent
sl-after-hideEmitted after the alert closes and all animations are complete.onSlAfterHideSlAfterHideEvent
Methods
namedescription
handleOpenChange -
handleDurationChange -
showShows the alert.
hideHides the alert
toastDisplays the alert as a toast notification. This will move the alert out of its position in the DOM and, when dismissed, it will be removed from the DOM completely. By storing a reference to the alert, you can reuse it by calling this method again. The returned promise will resolve after the alert is hidden.

sl-avatar

Properties
nametypedefaultdescriptionattributestaticreflects
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon } - - true -
image
{ "text": "string" }
''The image source to use for the avatar.image - -
label
{ "text": "string" }
''A label to use to describe the avatar to assistive devices.label - -
initials
{ "text": "string" }
''Initials to use as a fallback when no image is available (1-2 characters max recommended).initials - -
loading
{ "text": "'eager' | 'lazy'" }
'eager'Indicates how the browser should load the image.loading - -
shape
{ "text": "'circle' | 'square' | 'rounded'" }
'circle'The shape of the avatar.shape - true
Attributes
nametypedefaultdescriptionfieldName
image
{ "text": "string" }
''The image source to use for the avatar.image
label
{ "text": "string" }
''A label to use to describe the avatar to assistive devices.label
initials
{ "text": "string" }
''Initials to use as a fallback when no image is available (1-2 characters max recommended).initials
loading
{ "text": "'eager' | 'lazy'" }
'eager'Indicates how the browser should load the image.loading
shape
{ "text": "'circle' | 'square' | 'rounded'" }
'circle'The shape of the avatar.shape
CSS Properties
namedescription
--sizeThe size of the avatar.
CSS Parts
namedescription
baseThe component's base wrapper.
iconThe container that wraps the avatar's icon.
initialsThe container that wraps the avatar's initials.
imageThe avatar image. Only shown when the `image` attribute is set.
Slots
namedescription
iconThe default icon to use when no image or initials are present. Works best with `<sl-icon>`.
Methods
name
handleImageChange

sl-breadcrumb

Properties
nametypedefaultstaticdescriptionattribute
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon }true - -
defaultSlot
{ "text": "HTMLSlotElement" }
- - - -
separatorSlot
{ "text": "HTMLSlotElement" }
- - - -
label
{ "text": "string" }
'' - The label to use for the breadcrumb control. This will not be shown on the screen, but it will be announced by screen readers and other assistive devices to provide more context for users.label
Attributes
nametypedefaultdescriptionfieldName
label
{ "text": "string" }
''The label to use for the breadcrumb control. This will not be shown on the screen, but it will be announced by screen readers and other assistive devices to provide more context for users.label
CSS Parts
namedescription
baseThe component's base wrapper.
Slots
namedescription
One or more breadcrumb items to display.
separatorThe separator to use between breadcrumb items. Works best with `<sl-icon>`.

sl-breadcrumb-item

Properties
nametypedescriptionattributedefault
href
{ "text": "string | undefined" }
Optional URL to direct the user to when the breadcrumb item is activated. When set, a link will be rendered internally. When unset, a button will be rendered instead.href -
target
{ "text": "'_blank' | '_parent' | '_self' | '_top' | undefined" }
Tells the browser where to open the link. Only used when `href` is set.target -
rel
{ "text": "string" }
The `rel` attribute to use on the link. Only used when `href` is set.rel'noreferrer noopener'
Attributes
nametypedescriptionfieldNamedefault
href
{ "text": "string | undefined" }
Optional URL to direct the user to when the breadcrumb item is activated. When set, a link will be rendered internally. When unset, a button will be rendered instead.href -
target
{ "text": "'_blank' | '_parent' | '_self' | '_top' | undefined" }
Tells the browser where to open the link. Only used when `href` is set.target -
rel
{ "text": "string" }
The `rel` attribute to use on the link. Only used when `href` is set.rel'noreferrer noopener'
CSS Parts
namedescription
baseThe component's base wrapper.
labelThe breadcrumb item's label.
prefixThe container that wraps the prefix.
suffixThe container that wraps the suffix.
separatorThe container that wraps the separator.
Slots
namedescription
The breadcrumb item's label.
prefixAn optional prefix, usually an icon or icon button.
suffixAn optional suffix, usually an icon or icon button.
separatorThe separator to use for the breadcrumb item. This will only change the separator for this item. If you want to change it for all items in the group, set the separator on `<sl-breadcrumb>` instead.

sl-badge

Properties
nametypedefaultdescriptionattributereflects
variant
{ "text": "'primary' | 'success' | 'neutral' | 'warning' | 'danger'" }
'primary'The badge's theme variant.varianttrue
pill
{ "text": "boolean" }
falseDraws a pill-style badge with rounded edges.pilltrue
pulse
{ "text": "boolean" }
falseMakes the badge pulsate to draw attention.pulsetrue
Attributes
nametypedefaultdescriptionfieldName
variant
{ "text": "'primary' | 'success' | 'neutral' | 'warning' | 'danger'" }
'primary'The badge's theme variant.variant
pill
{ "text": "boolean" }
falseDraws a pill-style badge with rounded edges.pill
pulse
{ "text": "boolean" }
falseMakes the badge pulsate to draw attention.pulse
CSS Parts
namedescription
baseThe component's base wrapper.
Slots
namedescription
The badge's content.

sl-animation

Properties
nametypedescriptiondefaultattributereflects
defaultSlot
{ "text": "Promise" }
- - - -
name
{ "text": "string" }
The name of the built-in animation to use. For custom animations, use the `keyframes` prop.'none'name -
play
{ "text": "boolean" }
Plays the animation. When omitted, the animation will be paused. This attribute will be automatically removed when the animation finishes or gets canceled.falseplaytrue
delay
{ "text": "number" }
The number of milliseconds to delay the start of the animation.0delay -
direction
{ "text": "PlaybackDirection" }
Determines the direction of playback as well as the behavior when reaching the end of an iteration. [Learn more](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction)'normal'direction -
duration
{ "text": "number" }
The number of milliseconds each iteration of the animation takes to complete.1000duration -
easing
{ "text": "string" }
The easing function to use for the animation. This can be a Shoelace easing function or a custom easing function such as `cubic-bezier(0, 1, .76, 1.14)`.'linear'easing -
endDelay
{ "text": "number" }
The number of milliseconds to delay after the active period of an animation sequence.0end-delay -
fill
{ "text": "FillMode" }
Sets how the animation applies styles to its target before and after its execution.'auto'fill -
iterations - The number of iterations to run before the animation completes. Defaults to `Infinity`, which loops.Infinityiterations -
iterationStart
{ "text": "number" }
The offset at which to start the animation, usually between 0 (start) and 1 (end).0iteration-start -
keyframes
{ "text": "Keyframe[] | undefined" }
The keyframes to use for the animation. If this is set, `name` will be ignored. - - -
playbackRate
{ "text": "number" }
Sets the animation's playback rate. The default is `1`, which plays the animation at a normal speed. Setting this to `2`, for example, will double the animation's speed. A negative value can be used to reverse the animation. This value can be changed without causing the animation to restart.1playback-rate -
currentTime
{ "text": "CSSNumberish" }
Gets and sets the current animation time. - - -
Attributes
namedefaultdescriptionfieldNametyperesolveInitializer
name'none'The name of the built-in animation to use. For custom animations, use the `keyframes` prop.name
{ "text": "string" }
-
playfalsePlays the animation. When omitted, the animation will be paused. This attribute will be automatically removed when the animation finishes or gets canceled.play
{ "text": "boolean" }
-
delay0The number of milliseconds to delay the start of the animation.delay
{ "text": "number" }
-
direction'normal'Determines the direction of playback as well as the behavior when reaching the end of an iteration. [Learn more](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction)direction
{ "text": "PlaybackDirection" }
-
duration1000The number of milliseconds each iteration of the animation takes to complete.duration
{ "text": "number" }
-
easing'linear'The easing function to use for the animation. This can be a Shoelace easing function or a custom easing function such as `cubic-bezier(0, 1, .76, 1.14)`.easing
{ "text": "string" }
-
end-delay0The number of milliseconds to delay after the active period of an animation sequence.endDelay
{ "text": "number" }
-
fill'auto'Sets how the animation applies styles to its target before and after its execution.fill
{ "text": "FillMode" }
-
iterationsInfinityThe number of iterations to run before the animation completes. Defaults to `Infinity`, which loops.iterations -
{ "module": "src/components/animation/animation.component.ts" }
iteration-start0The offset at which to start the animation, usually between 0 (start) and 1 (end).iterationStart
{ "text": "number" }
-
playback-rate1Sets the animation's playback rate. The default is `1`, which plays the animation at a normal speed. Setting this to `2`, for example, will double the animation's speed. A negative value can be used to reverse the animation. This value can be changed without causing the animation to restart.playbackRate
{ "text": "number" }
-
Slots
namedescription
The element to animate. Avoid slotting in more than one element, as subsequent ones will be ignored. To animate multiple elements, either wrap them in a single container or use multiple `<sl-animation>` elements.
Events
namedescriptionreactNameeventName
sl-cancelEmitted when the animation is canceled.onSlCancelSlCancelEvent
sl-finishEmitted when the animation finishes.onSlFinishSlFinishEvent
sl-startEmitted when the animation starts or restarts.onSlStartSlStartEvent
Methods
namedescription
handleAnimationChange -
handlePlayChange -
handlePlaybackRateChange -
cancelClears all keyframe effects caused by this animation and aborts its playback.
finishSets the playback time to the end of the animation corresponding to the current playback direction.

sl-button

Properties
nametypedescriptionattributedefaultreflectsreadonlystatic
dependencies
{ "text": "object" }
- - { 'sl-icon': SlIcon, 'sl-spinner': SlSpinner } - - true
button
{ "text": "HTMLButtonElement | HTMLLinkElement" }
- - - - - -
invalid
{ "text": "boolean" }
- - false - - -
title
{ "text": "string" }
- title'' - - -
variant
{ "text": "'default' | 'primary' | 'success' | 'neutral' | 'warning' | 'danger' | 'text'" }
The button's theme variant.variant'default'true - -
size
{ "text": "'small' | 'medium' | 'large'" }
The button's size.size'medium'true - -
caret
{ "text": "boolean" }
Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior.caretfalsetrue - -
disabled
{ "text": "boolean" }
Disables the button.disabledfalsetrue - -
loading
{ "text": "boolean" }
Draws the button in a loading state.loadingfalsetrue - -
outline
{ "text": "boolean" }
Draws an outlined button.outlinefalsetrue - -
pill
{ "text": "boolean" }
Draws a pill-style button with rounded edges.pillfalsetrue - -
circle
{ "text": "boolean" }
Draws a circular icon button. When this attribute is present, the button expects a single `<sl-icon>` in the default slot.circlefalsetrue - -
type
{ "text": "'button' | 'submit' | 'reset'" }
The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native `<button>` elements behave. When the type is `submit`, the button will submit the surrounding form.type'button' - - -
name
{ "text": "string" }
The name of the button, submitted as a name/value pair with form data, but only when this button is the submitter. This attribute is ignored when `href` is present.name'' - - -
value
{ "text": "string" }
The value of the button, submitted as a pair with the button's name as part of the form data, but only when this button is the submitter. This attribute is ignored when `href` is present.value'' - - -
href
{ "text": "string" }
When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`.href'' - - -
target
{ "text": "'_blank' | '_parent' | '_self' | '_top'" }
Tells the browser where to open the link. Only used when `href` is present.target - - - -
rel
{ "text": "string" }
When using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the default is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a specific tab/window, this will prevent that from working correctly. You can remove or change the default value by setting the attribute to an empty string or a value of your choice, respectively.rel'noreferrer noopener' - - -
download
{ "text": "string | undefined" }
Tells the browser to download the linked file as this filename. Only used when `href` is present.download - - - -
form
{ "text": "string" }
The "form owner" to associate the button with. If omitted, the closest containing form will be used instead. The value of this attribute must be an id of a form in the same document or shadow root as the button.form - - - -
formAction
{ "text": "string" }
Used to override the form owner's `action` attribute.formaction - - - -
formEnctype
{ "text": "'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'" }
Used to override the form owner's `enctype` attribute.formenctype - - - -
formMethod
{ "text": "'post' | 'get'" }
Used to override the form owner's `method` attribute.formmethod - - - -
formNoValidate
{ "text": "boolean" }
Used to override the form owner's `novalidate` attribute.formnovalidate - - - -
formTarget
{ "text": "'_self' | '_blank' | '_parent' | '_top' | string" }
Used to override the form owner's `target` attribute.formtarget - - - -
validity - Gets the validity state object - - - true -
validationMessage - Gets the validation message - - - true -
Attributes
nametypefieldNamedescriptiondefault
title
{ "text": "string" }
title - ''
variant
{ "text": "'default' | 'primary' | 'success' | 'neutral' | 'warning' | 'danger' | 'text'" }
variantThe button's theme variant.'default'
size
{ "text": "'small' | 'medium' | 'large'" }
sizeThe button's size.'medium'
caret
{ "text": "boolean" }
caretDraws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior.false
disabled
{ "text": "boolean" }
disabledDisables the button.false
loading
{ "text": "boolean" }
loadingDraws the button in a loading state.false
outline
{ "text": "boolean" }
outlineDraws an outlined button.false
pill
{ "text": "boolean" }
pillDraws a pill-style button with rounded edges.false
circle
{ "text": "boolean" }
circleDraws a circular icon button. When this attribute is present, the button expects a single `<sl-icon>` in the default slot.false
type
{ "text": "'button' | 'submit' | 'reset'" }
typeThe type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native `<button>` elements behave. When the type is `submit`, the button will submit the surrounding form.'button'
name
{ "text": "string" }
nameThe name of the button, submitted as a name/value pair with form data, but only when this button is the submitter. This attribute is ignored when `href` is present.''
value
{ "text": "string" }
valueThe value of the button, submitted as a pair with the button's name as part of the form data, but only when this button is the submitter. This attribute is ignored when `href` is present.''
href
{ "text": "string" }
hrefWhen set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`.''
target
{ "text": "'_blank' | '_parent' | '_self' | '_top'" }
targetTells the browser where to open the link. Only used when `href` is present. -
rel
{ "text": "string" }
relWhen using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the default is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a specific tab/window, this will prevent that from working correctly. You can remove or change the default value by setting the attribute to an empty string or a value of your choice, respectively.'noreferrer noopener'
download
{ "text": "string | undefined" }
downloadTells the browser to download the linked file as this filename. Only used when `href` is present. -
form
{ "text": "string" }
formThe "form owner" to associate the button with. If omitted, the closest containing form will be used instead. The value of this attribute must be an id of a form in the same document or shadow root as the button. -
formaction
{ "text": "string" }
formActionUsed to override the form owner's `action` attribute. -
formenctype
{ "text": "'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'" }
formEnctypeUsed to override the form owner's `enctype` attribute. -
formmethod
{ "text": "'post' | 'get'" }
formMethodUsed to override the form owner's `method` attribute. -
formnovalidate
{ "text": "boolean" }
formNoValidateUsed to override the form owner's `novalidate` attribute. -
formtarget
{ "text": "'_self' | '_blank' | '_parent' | '_top' | string" }
formTargetUsed to override the form owner's `target` attribute. -
CSS Parts
namedescription
baseThe component's base wrapper.
prefixThe container that wraps the prefix.
labelThe button's label.
suffixThe container that wraps the suffix.
caretThe button's caret icon, an `<sl-icon>` element.
spinnerThe spinner that shows when the button is in the loading state.
Slots
namedescription
The button's label.
prefixA presentational prefix icon or similar element.
suffixA presentational suffix icon or similar element.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the button loses focus.onSlBlurSlBlurEvent
sl-focusEmitted when the button gains focus.onSlFocusSlFocusEvent
sl-invalidEmitted when the form control has been checked for validity and its constraints aren't satisfied.onSlInvalidSlInvalidEvent
Methods
namedescriptionparametersreturn
handleDisabledChange - - -
clickSimulates a click on the button. - -
focusSets focus on the button.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
-
blurRemoves focus from the button. - -
checkValidityChecks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. - -
getFormGets the associated form, if one exists. -
{ "type": { "text": "HTMLFormElement | null" } }
reportValidityChecks for validity and shows the browser's validation message if the control is invalid. - -
setCustomValiditySets a custom validation message. Pass an empty string to restore validity.
parameters
nametype
message
{ "text": "string" }
-

sl-animated-image

Properties
nametypedescriptionattributedefaultstaticreflects
dependencies
{ "text": "object" }
- - { 'sl-icon': SlIcon }true -
animatedImage
{ "text": "HTMLImageElement" }
- - - - -
frozenFrame
{ "text": "string" }
- - - - -
isLoaded
{ "text": "boolean" }
- - false - -
src
{ "text": "string" }
The path to the image to load.src - - -
alt
{ "text": "string" }
A description of the image used by assistive devices.alt - - -
play
{ "text": "boolean" }
Plays the animation. When this attribute is remove, the animation will pause.play - - true
Attributes
nametypedescriptionfieldName
src
{ "text": "string" }
The path to the image to load.src
alt
{ "text": "string" }
A description of the image used by assistive devices.alt
play
{ "text": "boolean" }
Plays the animation. When this attribute is remove, the animation will pause.play
CSS Properties
namedescription
--control-box-sizeThe size of the icon box.
--icon-sizeThe size of the play/pause icons.
CSS Parts
namedescription
control-boxThe container that surrounds the pause/play icons and provides their background.
Slots
namedescription
play-iconOptional play icon to use instead of the default. Works best with `<sl-icon>`.
pause-iconOptional pause icon to use instead of the default. Works best with `<sl-icon>`.
Events
namedescriptionreactNameeventName
sl-loadEmitted when the image loads successfully.onSlLoadSlLoadEvent
sl-errorEmitted when the image fails to load.onSlErrorSlErrorEvent
Methods
name
handlePlayChange
handleSrcChange

sl-button-group

Properties
nametypedefaultdescriptionattribute
defaultSlot
{ "text": "HTMLSlotElement" }
- - -
disableRole
{ "text": "boolean" }
false - -
label
{ "text": "string" }
''A label to use for the button group. This won't be displayed on the screen, but it will be announced by assistive devices when interacting with the control and is strongly recommended.label
Attributes
nametypedefaultdescriptionfieldName
label
{ "text": "string" }
''A label to use for the button group. This won't be displayed on the screen, but it will be announced by assistive devices when interacting with the control and is strongly recommended.label
CSS Parts
namedescription
baseThe component's base wrapper.
Slots
namedescription
One or more `<sl-button>` elements to display in the button group.

sl-card

CSS Properties
namedescription
--border-colorThe card's border color, including borders that occur inside the card.
--border-radiusThe border radius for the card's edges.
--border-widthThe width of the card's borders.
--paddingThe padding to use for the card's sections.
CSS Parts
namedescription
baseThe component's base wrapper.
imageThe container that wraps the card's image.
headerThe container that wraps the card's header.
bodyThe container that wraps the card's main content.
footerThe container that wraps the card's footer.
Slots
namedescription
The card's main content.
headerAn optional header for the card.
footerAn optional footer for the card.
imageAn optional image to render at the start of the card.

sl-carousel

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon } - - - true
loop
{ "text": "boolean" }
falseWhen set, allows the user to navigate the carousel in the same direction indefinitely.looptrue -
navigation
{ "text": "boolean" }
falseWhen set, show the carousel's navigation.navigationtrue -
pagination
{ "text": "boolean" }
falseWhen set, show the carousel's pagination indicators.paginationtrue -
autoplay
{ "text": "boolean" }
falseWhen set, the slides will scroll automatically when the user is not interacting with them.autoplaytrue -
autoplayInterval
{ "text": "number" }
3000Specifies the amount of time, in milliseconds, between each automatic scroll.autoplay-interval - -
slidesPerPage
{ "text": "number" }
1Specifies how many slides should be shown at a given time.slides-per-page - -
slidesPerMove
{ "text": "number" }
1Specifies the number of slides the carousel will advance when scrolling, useful when specifying a `slides-per-page` greater than one. It can't be higher than `slides-per-page`.slides-per-move - -
orientation
{ "text": "'horizontal' | 'vertical'" }
'horizontal'Specifies the orientation in which the carousel will lay out.orientation - -
mouseDragging
{ "text": "boolean" }
falseWhen set, it is possible to scroll through the slides by dragging them with the mouse.mouse-draggingtrue -
scrollContainer
{ "text": "HTMLElement" }
- - - - -
paginationContainer
{ "text": "HTMLElement" }
- - - - -
activeSlide
{ "text": "number" }
0 - - - -
scrolling
{ "text": "boolean" }
false - - - -
dragging
{ "text": "boolean" }
false - - - -
Attributes
nametypedefaultdescriptionfieldName
loop
{ "text": "boolean" }
falseWhen set, allows the user to navigate the carousel in the same direction indefinitely.loop
navigation
{ "text": "boolean" }
falseWhen set, show the carousel's navigation.navigation
pagination
{ "text": "boolean" }
falseWhen set, show the carousel's pagination indicators.pagination
autoplay
{ "text": "boolean" }
falseWhen set, the slides will scroll automatically when the user is not interacting with them.autoplay
autoplay-interval
{ "text": "number" }
3000Specifies the amount of time, in milliseconds, between each automatic scroll.autoplayInterval
slides-per-page
{ "text": "number" }
1Specifies how many slides should be shown at a given time.slidesPerPage
slides-per-move
{ "text": "number" }
1Specifies the number of slides the carousel will advance when scrolling, useful when specifying a `slides-per-page` greater than one. It can't be higher than `slides-per-page`.slidesPerMove
orientation
{ "text": "'horizontal' | 'vertical'" }
'horizontal'Specifies the orientation in which the carousel will lay out.orientation
mouse-dragging
{ "text": "boolean" }
falseWhen set, it is possible to scroll through the slides by dragging them with the mouse.mouseDragging
CSS Properties
namedescriptiondefault
--slide-gapThe space between each slide. -
--aspect-ratioThe aspect ratio of each slide.16/9
--scroll-hintThe amount of padding to apply to the scroll area, allowing adjacent slides to become partially visible as a scroll hint. -
CSS Parts
namedescription
baseThe carousel's internal wrapper.
scroll-containerThe scroll container that wraps the slides.
paginationThe pagination indicators wrapper.
pagination-itemThe pagination indicator.
pagination-item--activeApplied when the item is active.
navigationThe navigation wrapper.
navigation-buttonThe navigation button.
navigation-button--previousApplied to the previous button.
navigation-button--nextApplied to the next button.
Slots
namedescription
The carousel's main content, one or more `<sl-carousel-item>` elements.
next-iconOptional next icon to use instead of the default. Works best with `<sl-icon>`.
previous-iconOptional previous icon to use instead of the default. Works best with `<sl-icon>`.
Events
nametypedescriptionreactNameeventName
sl-slide-change
{ "text": "{ index: number, slide: SlCarouselItem }" }
Emitted when the active slide changes.onSlSlideChangeSlSlideChangeEvent
Methods
nameparametersdescription
initializeSlides - -
handelSlideChange - -
updateSlidesSnap - -
handleAutoplayChange - -
previous
parameters
namedefaulttypedescription
behavior'smooth'
{ "text": "ScrollBehavior" }
The behavior used for scrolling.
Move the carousel backward by `slides-per-move` slides.
next
parameters
namedefaulttypedescription
behavior'smooth'
{ "text": "ScrollBehavior" }
The behavior used for scrolling.
Move the carousel forward by `slides-per-move` slides.
goToSlide
parameters
nametypedescriptiondefault
index
{ "text": "number" }
The slide index. -
behavior
{ "text": "ScrollBehavior" }
The behavior used for scrolling.'smooth'
Scrolls the carousel to the slide specified by `index`.

sl-carousel-item

CSS Properties
namedescription
--aspect-ratioThe slide's aspect ratio. Inherited from the carousel by default.
Slots
namedescription
The carousel item's content..

sl-checkbox

Properties
nametypedescriptiondefaultattributereflectsreadonlystatic
dependencies
{ "text": "object" }
- { 'sl-icon': SlIcon } - - - true
input
{ "text": "HTMLInputElement" }
- - - - - -
title
{ "text": "string" }
- ''title - - -
name
{ "text": "string" }
The name of the checkbox, submitted as a name/value pair with form data.''name - - -
value
{ "text": "string" }
The current value of the checkbox, submitted as a name/value pair with form data. - value - - -
size
{ "text": "'small' | 'medium' | 'large'" }
The checkbox's size.'medium'sizetrue - -
disabled
{ "text": "boolean" }
Disables the checkbox.falsedisabledtrue - -
checked
{ "text": "boolean" }
Draws the checkbox in a checked state.falsecheckedtrue - -
indeterminate
{ "text": "boolean" }
Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a "select all/none" behavior when associated checkboxes have a mix of checked and unchecked states.falseindeterminatetrue - -
defaultChecked
{ "text": "boolean" }
The default value of the form control. Primarily used for resetting the form control.false - - - -
form
{ "text": "string" }
By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.''formtrue - -
required
{ "text": "boolean" }
Makes the checkbox a required field.falserequiredtrue - -
helpText
{ "text": "string" }
The checkbox's help text. If you need to display HTML, use the `help-text` slot instead.''help-text - - -
validity - Gets the validity state object - - - true -
validationMessage - Gets the validation message - - - true -
Attributes
nametypefieldNamedefaultdescription
title
{ "text": "string" }
title'' -
name
{ "text": "string" }
name''The name of the checkbox, submitted as a name/value pair with form data.
value
{ "text": "string" }
value - The current value of the checkbox, submitted as a name/value pair with form data.
size
{ "text": "'small' | 'medium' | 'large'" }
size'medium'The checkbox's size.
disabled
{ "text": "boolean" }
disabledfalseDisables the checkbox.
checked
{ "text": "boolean" }
checkedfalseDraws the checkbox in a checked state.
indeterminate
{ "text": "boolean" }
indeterminatefalseDraws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a "select all/none" behavior when associated checkboxes have a mix of checked and unchecked states.
form
{ "text": "string" }
form''By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.
required
{ "text": "boolean" }
requiredfalseMakes the checkbox a required field.
help-text
{ "text": "string" }
helpText''The checkbox's help text. If you need to display HTML, use the `help-text` slot instead.
CSS Parts
namedescription
baseThe component's base wrapper.
controlThe square container that wraps the checkbox's checked state.
control--checkedMatches the control part when the checkbox is checked.
control--indeterminateMatches the control part when the checkbox is indeterminate.
checked-iconThe checked icon, an `<sl-icon>` element.
indeterminate-iconThe indeterminate icon, an `<sl-icon>` element.
labelThe container that wraps the checkbox's label.
form-control-help-textThe help text's wrapper.
Slots
namedescription
The checkbox's label.
help-textText that describes how to use the checkbox. Alternatively, you can use the `help-text` attribute.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the checkbox loses focus.onSlBlurSlBlurEvent
sl-changeEmitted when the checked state changes.onSlChangeSlChangeEvent
sl-focusEmitted when the checkbox gains focus.onSlFocusSlFocusEvent
sl-inputEmitted when the checkbox receives input.onSlInputSlInputEvent
sl-invalidEmitted when the form control has been checked for validity and its constraints aren't satisfied.onSlInvalidSlInvalidEvent
Methods
namedescriptionparametersreturn
handleDisabledChange - - -
handleStateChange - - -
clickSimulates a click on the checkbox. - -
focusSets focus on the checkbox.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
-
blurRemoves focus from the checkbox. - -
checkValidityChecks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. - -
getFormGets the associated form, if one exists. -
{ "type": { "text": "HTMLFormElement | null" } }
reportValidityChecks for validity and shows the browser's validation message if the control is invalid. - -
setCustomValiditySets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear the custom validation message, call this method with an empty string.
parameters
nametype
message
{ "text": "string" }
-

sl-color-picker

Properties
nametypedescriptiondefaultattributereflectsreadonlystatic
dependencies
{ "text": "object" }
- { 'sl-button-group': SlButtonGroup, 'sl-button': SlButton, 'sl-dropdown': SlDropdown, 'sl-icon': SlIcon, 'sl-input': SlInput, 'sl-visually-hidden': SlVisuallyHidden } - - - true
base
{ "text": "HTMLElement" }
- - - - - -
input
{ "text": "SlInput" }
- - - - - -
dropdown
{ "text": "SlDropdown" }
- - - - - -
previewButton
{ "text": "HTMLButtonElement" }
- - - - - -
trigger
{ "text": "HTMLButtonElement" }
- - - - - -
value
{ "text": "string" }
The current value of the color picker. The value's format will vary based the `format` attribute. To get the value in a specific format, use the `getFormattedValue()` method. The value is submitted as a name/value pair with form data.''value - - -
defaultValue
{ "text": "string" }
The default value of the form control. Primarily used for resetting the form control.'' - - - -
label
{ "text": "string" }
The color picker's label. This will not be displayed, but it will be announced by assistive devices. If you need to display HTML, you can use the `label` slot` instead.''label - - -
format
{ "text": "'hex' | 'rgb' | 'hsl' | 'hsv'" }
The format to use. If opacity is enabled, these will translate to HEXA, RGBA, HSLA, and HSVA respectively. The color picker will accept user input in any format (including CSS color names) and convert it to the desired format.'hex'format - - -
inline
{ "text": "boolean" }
Renders the color picker inline rather than in a dropdown.falseinlinetrue - -
size
{ "text": "'small' | 'medium' | 'large'" }
Determines the size of the color picker's trigger. This has no effect on inline color pickers.'medium'sizetrue - -
noFormatToggle
{ "text": "boolean" }
Removes the button that lets users toggle between format.falseno-format-toggle - - -
name
{ "text": "string" }
The name of the form control, submitted as a name/value pair with form data.''name - - -
disabled
{ "text": "boolean" }
Disables the color picker.falsedisabledtrue - -
hoist
{ "text": "boolean" }
Enable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.falsehoist - - -
opacity
{ "text": "boolean" }
Shows the opacity slider. Enabling this will cause the formatted value to be HEXA, RGBA, or HSLA.falseopacity - - -
uppercase
{ "text": "boolean" }
By default, values are lowercase. With this attribute, values will be uppercase instead.falseuppercase - - -
swatches
{ "text": "string | string[]" }
One or more predefined color swatches to display as presets in the color picker. Can include any format the color picker can parse, including HEX(A), RGB(A), HSL(A), HSV(A), and CSS color names. Each color must be separated by a semicolon (`;`). Alternatively, you can pass an array of color values to this property using JavaScript.''swatches - - -
form
{ "text": "string" }
By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.''formtrue - -
required
{ "text": "boolean" }
Makes the color picker a required field.falserequiredtrue - -
validity - Gets the validity state object - - - true -
validationMessage - Gets the validation message - - - true -
Attributes
nametypedefaultdescriptionfieldName
value
{ "text": "string" }
''The current value of the color picker. The value's format will vary based the `format` attribute. To get the value in a specific format, use the `getFormattedValue()` method. The value is submitted as a name/value pair with form data.value
label
{ "text": "string" }
''The color picker's label. This will not be displayed, but it will be announced by assistive devices. If you need to display HTML, you can use the `label` slot` instead.label
format
{ "text": "'hex' | 'rgb' | 'hsl' | 'hsv'" }
'hex'The format to use. If opacity is enabled, these will translate to HEXA, RGBA, HSLA, and HSVA respectively. The color picker will accept user input in any format (including CSS color names) and convert it to the desired format.format
inline
{ "text": "boolean" }
falseRenders the color picker inline rather than in a dropdown.inline
size
{ "text": "'small' | 'medium' | 'large'" }
'medium'Determines the size of the color picker's trigger. This has no effect on inline color pickers.size
no-format-toggle
{ "text": "boolean" }
falseRemoves the button that lets users toggle between format.noFormatToggle
name
{ "text": "string" }
''The name of the form control, submitted as a name/value pair with form data.name
disabled
{ "text": "boolean" }
falseDisables the color picker.disabled
hoist
{ "text": "boolean" }
falseEnable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.hoist
opacity
{ "text": "boolean" }
falseShows the opacity slider. Enabling this will cause the formatted value to be HEXA, RGBA, or HSLA.opacity
uppercase
{ "text": "boolean" }
falseBy default, values are lowercase. With this attribute, values will be uppercase instead.uppercase
swatches
{ "text": "string | string[]" }
''One or more predefined color swatches to display as presets in the color picker. Can include any format the color picker can parse, including HEX(A), RGB(A), HSL(A), HSV(A), and CSS color names. Each color must be separated by a semicolon (`;`). Alternatively, you can pass an array of color values to this property using JavaScript.swatches
form
{ "text": "string" }
''By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.form
required
{ "text": "boolean" }
falseMakes the color picker a required field.required
CSS Properties
namedescription
--grid-widthThe width of the color grid.
--grid-heightThe height of the color grid.
--grid-handle-sizeThe size of the color grid's handle.
--slider-heightThe height of the hue and alpha sliders.
--slider-handle-sizeThe diameter of the slider's handle.
--swatch-sizeThe size of each predefined color swatch.
CSS Parts
namedescription
baseThe component's base wrapper.
triggerThe color picker's dropdown trigger.
swatchesThe container that holds the swatches.
swatchEach individual swatch.
gridThe color grid.
grid-handleThe color grid's handle.
sliderHue and opacity sliders.
slider-handleHue and opacity slider handles.
hue-sliderThe hue slider.
hue-slider-handleThe hue slider's handle.
opacity-sliderThe opacity slider.
opacity-slider-handleThe opacity slider's handle.
previewThe preview color.
inputThe text input.
eye-dropper-buttonThe eye dropper button.
eye-dropper-button__baseThe eye dropper button's exported `button` part.
eye-dropper-button__prefixThe eye dropper button's exported `prefix` part.
eye-dropper-button__labelThe eye dropper button's exported `label` part.
eye-dropper-button__suffixThe eye dropper button's exported `suffix` part.
eye-dropper-button__caretThe eye dropper button's exported `caret` part.
format-buttonThe format button.
format-button__baseThe format button's exported `button` part.
format-button__prefixThe format button's exported `prefix` part.
format-button__labelThe format button's exported `label` part.
format-button__suffixThe format button's exported `suffix` part.
format-button__caretThe format button's exported `caret` part.
Slots
namedescription
labelThe color picker's form label. Alternatively, you can use the `label` attribute.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the color picker loses focus.onSlBlurSlBlurEvent
sl-changeEmitted when the color picker's value changes.onSlChangeSlChangeEvent
sl-focusEmitted when the color picker receives focus.onSlFocusSlFocusEvent
sl-inputEmitted when the color picker receives input.onSlInputSlInputEvent
sl-invalidEmitted when the form control has been checked for validity and its constraints aren't satisfied.onSlInvalidSlInvalidEvent
Methods
namedescriptionparametersreturn
handleFormatChange - - -
handleOpacityChange - - -
handleValueChange -
parameters
nametype
oldValue
{ "text": "string | undefined" }
newValue
{ "text": "string" }
-
focusSets focus on the color picker.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
-
blurRemoves focus from the color picker. - -
getFormattedValueReturns the current value as a string in the specified format.
parameters
namedefaulttype
format'hex'
{ "text": "'hex' | 'hexa' | 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'hsv' | 'hsva'" }
-
checkValidityChecks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. - -
getFormGets the associated form, if one exists. -
{ "type": { "text": "HTMLFormElement | null" } }
reportValidityChecks for validity and shows the browser's validation message if the control is invalid. - -
setCustomValiditySets a custom validation message. Pass an empty string to restore validity.
parameters
nametype
message
{ "text": "string" }
-

sl-copy-button

Properties
nametypedefaultdescriptionattributestaticreflects
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon, 'sl-tooltip': SlTooltip } - - true -
copyIcon
{ "text": "HTMLSlotElement" }
- - - - -
successIcon
{ "text": "HTMLSlotElement" }
- - - - -
errorIcon
{ "text": "HTMLSlotElement" }
- - - - -
tooltip
{ "text": "SlTooltip" }
- - - - -
isCopying
{ "text": "boolean" }
false - - - -
status
{ "text": "'rest' | 'success' | 'error'" }
'rest' - - - -
value
{ "text": "string" }
''The text value to copy.value - -
from
{ "text": "string" }
''An id that references an element in the same document from which data will be copied. If both this and `value` are present, this value will take precedence. By default, the target element's `textContent` will be copied. To copy an attribute, append the attribute name wrapped in square brackets, e.g. `from="el[value]"`. To copy a property, append a dot and the property name, e.g. `from="el.value"`.from - -
disabled
{ "text": "boolean" }
falseDisables the copy button.disabled - true
copyLabel
{ "text": "string" }
''A custom label to show in the tooltip.copy-label - -
successLabel
{ "text": "string" }
''A custom label to show in the tooltip after copying.success-label - -
errorLabel
{ "text": "string" }
''A custom label to show in the tooltip when a copy error occurs.error-label - -
feedbackDuration
{ "text": "number" }
1000The length of time to show feedback before restoring the default trigger.feedback-duration - -
tooltipPlacement
{ "text": "'top' | 'right' | 'bottom' | 'left'" }
'top'The preferred placement of the tooltip.tooltip-placement - -
hoist
{ "text": "boolean" }
falseEnable this option to prevent the tooltip from being clipped when the component is placed inside a container with `overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.hoist - -
Attributes
nametypedefaultdescriptionfieldName
value
{ "text": "string" }
''The text value to copy.value
from
{ "text": "string" }
''An id that references an element in the same document from which data will be copied. If both this and `value` are present, this value will take precedence. By default, the target element's `textContent` will be copied. To copy an attribute, append the attribute name wrapped in square brackets, e.g. `from="el[value]"`. To copy a property, append a dot and the property name, e.g. `from="el.value"`.from
disabled
{ "text": "boolean" }
falseDisables the copy button.disabled
copy-label
{ "text": "string" }
''A custom label to show in the tooltip.copyLabel
success-label
{ "text": "string" }
''A custom label to show in the tooltip after copying.successLabel
error-label
{ "text": "string" }
''A custom label to show in the tooltip when a copy error occurs.errorLabel
feedback-duration
{ "text": "number" }
1000The length of time to show feedback before restoring the default trigger.feedbackDuration
tooltip-placement
{ "text": "'top' | 'right' | 'bottom' | 'left'" }
'top'The preferred placement of the tooltip.tooltipPlacement
hoist
{ "text": "boolean" }
falseEnable this option to prevent the tooltip from being clipped when the component is placed inside a container with `overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.hoist
CSS Properties
namedescription
--success-colorThe color to use for success feedback.
--error-colorThe color to use for error feedback.
CSS Parts
namedescription
buttonThe internal `<button>` element.
copy-iconThe container that holds the copy icon.
success-iconThe container that holds the success icon.
error-iconThe container that holds the error icon.
tooltip__baseThe tooltip's exported `base` part.
tooltip__base__popupThe tooltip's exported `popup` part.
tooltip__base__arrowThe tooltip's exported `arrow` part.
tooltip__bodyThe tooltip's exported `body` part.
Slots
namedescription
copy-iconThe icon to show in the default copy state. Works best with `<sl-icon>`.
success-iconThe icon to show when the content is copied. Works best with `<sl-icon>`.
error-iconThe icon to show when a copy error occurs. Works best with `<sl-icon>`.
Events
namedescriptionreactNameeventName
sl-copyEmitted when the data has been copied.onSlCopySlCopyEvent
sl-errorEmitted when the data could not be copied.onSlErrorSlErrorEvent

sl-details

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon } - - - true
details
{ "text": "HTMLDetailsElement" }
- - - - -
header
{ "text": "HTMLElement" }
- - - - -
body
{ "text": "HTMLElement" }
- - - - -
expandIconSlot
{ "text": "HTMLSlotElement" }
- - - - -
detailsObserver
{ "text": "MutationObserver" }
- - - - -
open
{ "text": "boolean" }
falseIndicates whether or not the details is open. You can toggle this attribute to show and hide the details, or you can use the `show()` and `hide()` methods and this attribute will reflect the details' open state.opentrue -
summary
{ "text": "string" }
- The summary to show in the header. If you need to display HTML, use the `summary` slot instead.summary - -
disabled
{ "text": "boolean" }
falseDisables the details so it can't be toggled.disabledtrue -
Attributes
nametypedescriptionfieldNamedefault
open
{ "text": "boolean" }
Indicates whether or not the details is open. You can toggle this attribute to show and hide the details, or you can use the `show()` and `hide()` methods and this attribute will reflect the details' open state.openfalse
summary
{ "text": "string" }
The summary to show in the header. If you need to display HTML, use the `summary` slot instead.summary -
disabled
{ "text": "boolean" }
Disables the details so it can't be toggled.disabledfalse
CSS Parts
namedescription
baseThe component's base wrapper.
headerThe header that wraps both the summary and the expand/collapse icon.
summaryThe container that wraps the summary.
summary-iconThe container that wraps the expand/collapse icons.
contentThe details content.
Slots
namedescription
The details' main content.
summaryThe details' summary. Alternatively, you can use the `summary` attribute.
expand-iconOptional expand icon to use instead of the default. Works best with `<sl-icon>`.
collapse-iconOptional collapse icon to use instead of the default. Works best with `<sl-icon>`.
Events
namedescriptionreactNameeventName
sl-showEmitted when the details opens.onSlShowSlShowEvent
sl-after-showEmitted after the details opens and all animations are complete.onSlAfterShowSlAfterShowEvent
sl-hideEmitted when the details closes.onSlHideSlHideEvent
sl-after-hideEmitted after the details closes and all animations are complete.onSlAfterHideSlAfterHideEvent
Methods
namedescription
handleOpenChange -
showShows the details.
hideHides the details

sl-dialog

Properties
nametypedefaultdescriptionattributereflectsstaticprivacy
dependencies
{ "text": "object" }
{ 'sl-icon-button': SlIconButton } - - - true -
modal - new Modal(this)Exposes the internal modal utility that controls focus trapping. To temporarily disable focus trapping and allow third-party modals spawned from an active Shoelace modal, call `modal.activateExternal()` when the third-party modal opens. Upon closing, call `modal.deactivateExternal()` to restore Shoelace's focus trapping. - - - public
dialog
{ "text": "HTMLElement" }
- - - - - -
panel
{ "text": "HTMLElement" }
- - - - - -
overlay
{ "text": "HTMLElement" }
- - - - - -
open
{ "text": "boolean" }
falseIndicates whether or not the dialog is open. You can toggle this attribute to show and hide the dialog, or you can use the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.opentrue - -
label
{ "text": "string" }
''The dialog's label as displayed in the header. You should always include a relevant label even when using `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.labeltrue - -
noHeader
{ "text": "boolean" }
falseDisables the header. This will also remove the default close button, so please ensure you provide an easy, accessible way for users to dismiss the dialog.no-headertrue - -
Attributes
nametypedefaultdescriptionfieldName
open
{ "text": "boolean" }
falseIndicates whether or not the dialog is open. You can toggle this attribute to show and hide the dialog, or you can use the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.open
label
{ "text": "string" }
''The dialog's label as displayed in the header. You should always include a relevant label even when using `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.label
no-header
{ "text": "boolean" }
falseDisables the header. This will also remove the default close button, so please ensure you provide an easy, accessible way for users to dismiss the dialog.noHeader
CSS Properties
namedescription
--widthThe preferred width of the dialog. Note that the dialog will shrink to accommodate smaller screens.
--header-spacingThe amount of padding to use for the header.
--body-spacingThe amount of padding to use for the body.
--footer-spacingThe amount of padding to use for the footer.
CSS Parts
namedescription
baseThe component's base wrapper.
overlayThe overlay that covers the screen behind the dialog.
panelThe dialog's panel (where the dialog and its content are rendered).
headerThe dialog's header. This element wraps the title and header actions.
header-actionsOptional actions to add to the header. Works best with `<sl-icon-button>`.
titleThe dialog's title.
close-buttonThe close button, an `<sl-icon-button>`.
close-button__baseThe close button's exported `base` part.
bodyThe dialog's body.
footerThe dialog's footer.
Slots
namedescription
The dialog's main content.
labelThe dialog's label. Alternatively, you can use the `label` attribute.
header-actionsOptional actions to add to the header. Works best with `<sl-icon-button>`.
footerThe dialog's footer, usually one or more buttons representing various options.
Events
namedescriptionreactNameeventNametype
sl-showEmitted when the dialog opens.onSlShowSlShowEvent -
sl-after-showEmitted after the dialog opens and all animations are complete.onSlAfterShowSlAfterShowEvent -
sl-hideEmitted when the dialog closes.onSlHideSlHideEvent -
sl-after-hideEmitted after the dialog closes and all animations are complete.onSlAfterHideSlAfterHideEvent -
sl-initial-focusEmitted when the dialog opens and is ready to receive focus. Calling `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.onSlInitialFocusSlInitialFocusEvent -
sl-request-closeEmitted when the user attempts to close the dialog by clicking the close button, clicking the overlay, or pressing escape. Calling `event.preventDefault()` will keep the dialog open. Avoid using this unless closing the dialog will result in destructive behavior such as data loss.onSlRequestCloseSlRequestCloseEvent
{ "text": "{ source: 'close-button' | 'keyboard' | 'overlay' }" }
Methods
namedescription
handleOpenChange -
showShows the dialog.
hideHides the dialog

sl-divider

Properties
nametypedefaultdescriptionattributereflects
vertical
{ "text": "boolean" }
falseDraws the divider in a vertical orientation.verticaltrue
Attributes
nametypedefaultdescriptionfieldName
vertical
{ "text": "boolean" }
falseDraws the divider in a vertical orientation.vertical
CSS Properties
namedescription
--colorThe color of the divider.
--widthThe width of the divider.
--spacingThe spacing of the divider.
Methods
name
handleVerticalChange

sl-drawer

Properties
nametypedefaultdescriptionattributereflectsstaticprivacy
dependencies
{ "text": "object" }
{ 'sl-icon-button': SlIconButton } - - - true -
modal - new Modal(this)Exposes the internal modal utility that controls focus trapping. To temporarily disable focus trapping and allow third-party modals spawned from an active Shoelace modal, call `modal.activateExternal()` when the third-party modal opens. Upon closing, call `modal.deactivateExternal()` to restore Shoelace's focus trapping. - - - public
drawer
{ "text": "HTMLElement" }
- - - - - -
panel
{ "text": "HTMLElement" }
- - - - - -
overlay
{ "text": "HTMLElement" }
- - - - - -
open
{ "text": "boolean" }
falseIndicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.opentrue - -
label
{ "text": "string" }
''The drawer's label as displayed in the header. You should always include a relevant label even when using `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.labeltrue - -
placement
{ "text": "'top' | 'end' | 'bottom' | 'start'" }
'end'The direction from which the drawer will open.placementtrue - -
contained
{ "text": "boolean" }
falseBy default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of its parent element, set this attribute and add `position: relative` to the parent.containedtrue - -
noHeader
{ "text": "boolean" }
falseRemoves the header. This will also remove the default close button, so please ensure you provide an easy, accessible way for users to dismiss the drawer.no-headertrue - -
Attributes
nametypedefaultdescriptionfieldName
open
{ "text": "boolean" }
falseIndicates whether or not the drawer is open. You can toggle this attribute to show and hide the drawer, or you can use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.open
label
{ "text": "string" }
''The drawer's label as displayed in the header. You should always include a relevant label even when using `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.label
placement
{ "text": "'top' | 'end' | 'bottom' | 'start'" }
'end'The direction from which the drawer will open.placement
contained
{ "text": "boolean" }
falseBy default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of its parent element, set this attribute and add `position: relative` to the parent.contained
no-header
{ "text": "boolean" }
falseRemoves the header. This will also remove the default close button, so please ensure you provide an easy, accessible way for users to dismiss the drawer.noHeader
CSS Properties
namedescription
--sizeThe preferred size of the drawer. This will be applied to the drawer's width or height depending on its `placement`. Note that the drawer will shrink to accommodate smaller screens.
--header-spacingThe amount of padding to use for the header.
--body-spacingThe amount of padding to use for the body.
--footer-spacingThe amount of padding to use for the footer.
CSS Parts
namedescription
baseThe component's base wrapper.
overlayThe overlay that covers the screen behind the drawer.
panelThe drawer's panel (where the drawer and its content are rendered).
headerThe drawer's header. This element wraps the title and header actions.
header-actionsOptional actions to add to the header. Works best with `<sl-icon-button>`.
titleThe drawer's title.
close-buttonThe close button, an `<sl-icon-button>`.
close-button__baseThe close button's exported `base` part.
bodyThe drawer's body.
footerThe drawer's footer.
Slots
namedescription
The drawer's main content.
labelThe drawer's label. Alternatively, you can use the `label` attribute.
header-actionsOptional actions to add to the header. Works best with `<sl-icon-button>`.
footerThe drawer's footer, usually one or more buttons representing various options.
Events
namedescriptionreactNameeventNametype
sl-showEmitted when the drawer opens.onSlShowSlShowEvent -
sl-after-showEmitted after the drawer opens and all animations are complete.onSlAfterShowSlAfterShowEvent -
sl-hideEmitted when the drawer closes.onSlHideSlHideEvent -
sl-after-hideEmitted after the drawer closes and all animations are complete.onSlAfterHideSlAfterHideEvent -
sl-initial-focusEmitted when the drawer opens and is ready to receive focus. Calling `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input.onSlInitialFocusSlInitialFocusEvent -
sl-request-closeEmitted when the user attempts to close the drawer by clicking the close button, clicking the overlay, or pressing escape. Calling `event.preventDefault()` will keep the drawer open. Avoid using this unless closing the drawer will result in destructive behavior such as data loss.onSlRequestCloseSlRequestCloseEvent
{ "text": "{ source: 'close-button' | 'keyboard' | 'overlay' }" }
Methods
namedescription
handleOpenChange -
handleNoModalChange -
showShows the drawer.
hideHides the drawer

sl-dropdown

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-popup': SlPopup } - - - true
popup
{ "text": "SlPopup" }
- - - - -
trigger
{ "text": "HTMLSlotElement" }
- - - - -
panel
{ "text": "HTMLSlotElement" }
- - - - -
open
{ "text": "boolean" }
falseIndicates whether or not the dropdown is open. You can toggle this attribute to show and hide the dropdown, or you can use the `show()` and `hide()` methods and this attribute will reflect the dropdown's open state.opentrue -
placement
{ "text": "| 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end'" }
'bottom-start'The preferred placement of the dropdown panel. Note that the actual placement may vary as needed to keep the panel inside of the viewport.placementtrue -
disabled
{ "text": "boolean" }
falseDisables the dropdown so the panel will not open.disabledtrue -
stayOpenOnSelect
{ "text": "boolean" }
falseBy default, the dropdown is closed when an item is selected. This attribute will keep it open instead. Useful for dropdowns that allow for multiple interactions.stay-open-on-selecttrue -
containingElement
{ "text": "HTMLElement | undefined" }
- The dropdown will close when the user interacts outside of this element (e.g. clicking). Useful for composing other components that use a dropdown internally. - - -
distance
{ "text": "number" }
0The distance in pixels from which to offset the panel away from its trigger.distance - -
skidding
{ "text": "number" }
0The distance in pixels from which to offset the panel along its trigger.skidding - -
hoist
{ "text": "boolean" }
falseEnable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.hoist - -
sync
{ "text": "'width' | 'height' | 'both' | undefined" }
undefinedSyncs the popup width or height to that of the trigger element.synctrue -
Attributes
nametypedefaultdescriptionfieldNameresolveInitializer
open
{ "text": "boolean" }
falseIndicates whether or not the dropdown is open. You can toggle this attribute to show and hide the dropdown, or you can use the `show()` and `hide()` methods and this attribute will reflect the dropdown's open state.open -
placement
{ "text": "| 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end'" }
'bottom-start'The preferred placement of the dropdown panel. Note that the actual placement may vary as needed to keep the panel inside of the viewport.placement -
disabled
{ "text": "boolean" }
falseDisables the dropdown so the panel will not open.disabled -
stay-open-on-select
{ "text": "boolean" }
falseBy default, the dropdown is closed when an item is selected. This attribute will keep it open instead. Useful for dropdowns that allow for multiple interactions.stayOpenOnSelect -
distance
{ "text": "number" }
0The distance in pixels from which to offset the panel away from its trigger.distance -
skidding
{ "text": "number" }
0The distance in pixels from which to offset the panel along its trigger.skidding -
hoist
{ "text": "boolean" }
falseEnable this option to prevent the panel from being clipped when the component is placed inside a container with `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.hoist -
sync
{ "text": "'width' | 'height' | 'both' | undefined" }
undefinedSyncs the popup width or height to that of the trigger element.sync
{ "module": "src/components/dropdown/dropdown.component.ts" }
CSS Parts
namedescription
baseThe component's base wrapper.
triggerThe container that wraps the trigger.
panelThe panel that gets shown when the dropdown is open.
Slots
namedescription
The dropdown's main content.
triggerThe dropdown's trigger, usually a `<sl-button>` element.
Events
namedescriptionreactNameeventName
sl-showEmitted when the dropdown opens.onSlShowSlShowEvent
sl-after-showEmitted after the dropdown opens and all animations are complete.onSlAfterShowSlAfterShowEvent
sl-hideEmitted when the dropdown closes.onSlHideSlHideEvent
sl-after-hideEmitted after the dropdown closes and all animations are complete.onSlAfterHideSlAfterHideEvent
Methods
namedescriptionparameters
focusOnTrigger - -
getMenu - -
handleTriggerClick - -
handleTriggerKeyDown -
parameters
nametype
event
{ "text": "KeyboardEvent" }
handleTriggerKeyUp -
parameters
nametype
event
{ "text": "KeyboardEvent" }
handleTriggerSlotChange - -
updateAccessibleTrigger - -
showShows the dropdown panel. -
hideHides the dropdown panel -
repositionInstructs the dropdown menu to reposition. Useful when the position or size of the trigger changes when the menu is activated. -
addOpenListeners - -
removeOpenListeners - -
handleOpenChange - -

sl-format-bytes

Properties
nametypedefaultdescriptionattribute
value
{ "text": "number" }
0The number to format in bytes.value
unit
{ "text": "'byte' | 'bit'" }
'byte'The type of unit to display.unit
display
{ "text": "'long' | 'short' | 'narrow'" }
'short'Determines how to display the result, e.g. "100 bytes", "100 b", or "100b".display
Attributes
nametypedefaultdescriptionfieldName
value
{ "text": "number" }
0The number to format in bytes.value
unit
{ "text": "'byte' | 'bit'" }
'byte'The type of unit to display.unit
display
{ "text": "'long' | 'short' | 'narrow'" }
'short'Determines how to display the result, e.g. "100 bytes", "100 b", or "100b".display

sl-format-date

Properties
nametypedescriptionattributedefault
date
{ "text": "Date | string" }
The date/time to format. If not set, the current date and time will be used. When passing a string, it's strongly recommended to use the ISO 8601 format to ensure timezones are handled correctly. To convert a date to this format in JavaScript, use [`date.toISOString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString).datenew Date()
weekday
{ "text": "'narrow' | 'short' | 'long'" }
The format for displaying the weekday.weekday -
era
{ "text": "'narrow' | 'short' | 'long'" }
The format for displaying the era.era -
year
{ "text": "'numeric' | '2-digit'" }
The format for displaying the year.year -
month
{ "text": "'numeric' | '2-digit' | 'narrow' | 'short' | 'long'" }
The format for displaying the month.month -
day
{ "text": "'numeric' | '2-digit'" }
The format for displaying the day.day -
hour
{ "text": "'numeric' | '2-digit'" }
The format for displaying the hour.hour -
minute
{ "text": "'numeric' | '2-digit'" }
The format for displaying the minute.minute -
second
{ "text": "'numeric' | '2-digit'" }
The format for displaying the second.second -
timeZoneName
{ "text": "'short' | 'long'" }
The format for displaying the time.time-zone-name -
timeZone
{ "text": "string" }
The time zone to express the time in.time-zone -
hourFormat
{ "text": "'auto' | '12' | '24'" }
The format for displaying the hour.hour-format'auto'
Attributes
nametypedescriptionfieldNamedefault
date
{ "text": "Date | string" }
The date/time to format. If not set, the current date and time will be used. When passing a string, it's strongly recommended to use the ISO 8601 format to ensure timezones are handled correctly. To convert a date to this format in JavaScript, use [`date.toISOString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString).datenew Date()
weekday
{ "text": "'narrow' | 'short' | 'long'" }
The format for displaying the weekday.weekday -
era
{ "text": "'narrow' | 'short' | 'long'" }
The format for displaying the era.era -
year
{ "text": "'numeric' | '2-digit'" }
The format for displaying the year.year -
month
{ "text": "'numeric' | '2-digit' | 'narrow' | 'short' | 'long'" }
The format for displaying the month.month -
day
{ "text": "'numeric' | '2-digit'" }
The format for displaying the day.day -
hour
{ "text": "'numeric' | '2-digit'" }
The format for displaying the hour.hour -
minute
{ "text": "'numeric' | '2-digit'" }
The format for displaying the minute.minute -
second
{ "text": "'numeric' | '2-digit'" }
The format for displaying the second.second -
time-zone-name
{ "text": "'short' | 'long'" }
The format for displaying the time.timeZoneName -
time-zone
{ "text": "string" }
The time zone to express the time in.timeZone -
hour-format
{ "text": "'auto' | '12' | '24'" }
The format for displaying the hour.hourFormat'auto'

sl-format-number

Properties
nametypedescriptionattributedefault
value
{ "text": "number" }
The number to format.value0
type
{ "text": "'currency' | 'decimal' | 'percent'" }
The formatting style to use.type'decimal'
noGrouping
{ "text": "boolean" }
Turns off grouping separators.no-groupingfalse
currency
{ "text": "string" }
The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code to use when formatting.currency'USD'
currencyDisplay
{ "text": "'symbol' | 'narrowSymbol' | 'code' | 'name'" }
How to display the currency.currency-display'symbol'
minimumIntegerDigits
{ "text": "number" }
The minimum number of integer digits to use. Possible values are 1-21.minimum-integer-digits -
minimumFractionDigits
{ "text": "number" }
The minimum number of fraction digits to use. Possible values are 0-20.minimum-fraction-digits -
maximumFractionDigits
{ "text": "number" }
The maximum number of fraction digits to use. Possible values are 0-0.maximum-fraction-digits -
minimumSignificantDigits
{ "text": "number" }
The minimum number of significant digits to use. Possible values are 1-21.minimum-significant-digits -
maximumSignificantDigits
{ "text": "number" }
The maximum number of significant digits to use,. Possible values are 1-21.maximum-significant-digits -
Attributes
nametypedescriptionfieldNamedefault
value
{ "text": "number" }
The number to format.value0
type
{ "text": "'currency' | 'decimal' | 'percent'" }
The formatting style to use.type'decimal'
no-grouping
{ "text": "boolean" }
Turns off grouping separators.noGroupingfalse
currency
{ "text": "string" }
The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code to use when formatting.currency'USD'
currency-display
{ "text": "'symbol' | 'narrowSymbol' | 'code' | 'name'" }
How to display the currency.currencyDisplay'symbol'
minimum-integer-digits
{ "text": "number" }
The minimum number of integer digits to use. Possible values are 1-21.minimumIntegerDigits -
minimum-fraction-digits
{ "text": "number" }
The minimum number of fraction digits to use. Possible values are 0-20.minimumFractionDigits -
maximum-fraction-digits
{ "text": "number" }
The maximum number of fraction digits to use. Possible values are 0-0.maximumFractionDigits -
minimum-significant-digits
{ "text": "number" }
The minimum number of significant digits to use. Possible values are 1-21.minimumSignificantDigits -
maximum-significant-digits
{ "text": "number" }
The maximum number of significant digits to use,. Possible values are 1-21.maximumSignificantDigits -

sl-icon

Properties
nametypedescriptionattributereflectsdefault
name
{ "text": "string | undefined" }
The name of the icon to draw. Available names depend on the icon library being used.nametrue -
src
{ "text": "string | undefined" }
An external URL of an SVG file. Be sure you trust the content you are including, as it will be executed as code and can result in XSS attacks.src - -
label
{ "text": "string" }
An alternate description to use for assistive devices. If omitted, the icon will be considered presentational and ignored by assistive devices.label - ''
library
{ "text": "string" }
The name of a registered custom icon library.librarytrue'default'
Attributes
nametypedescriptionfieldNamedefault
name
{ "text": "string | undefined" }
The name of the icon to draw. Available names depend on the icon library being used.name -
src
{ "text": "string | undefined" }
An external URL of an SVG file. Be sure you trust the content you are including, as it will be executed as code and can result in XSS attacks.src -
label
{ "text": "string" }
An alternate description to use for assistive devices. If omitted, the icon will be considered presentational and ignored by assistive devices.label''
library
{ "text": "string" }
The name of a registered custom icon library.library'default'
CSS Parts
namedescription
svgThe internal SVG element.
useThe <use> element generated when using `spriteSheet: true`
Events
namedescriptionreactNameeventName
sl-loadEmitted when the icon has loaded. When using `spriteSheet: true` this will not emit.onSlLoadSlLoadEvent
sl-errorEmitted when the icon fails to load due to an error. When using `spriteSheet: true` this will not emit.onSlErrorSlErrorEvent
Methods
name
handleLabelChange
setIcon

sl-icon-button

Properties
nametypedescriptionattributedefaultstaticreflects
dependencies
{ "text": "object" }
- - { 'sl-icon': SlIcon }true -
button
{ "text": "HTMLButtonElement | HTMLLinkElement" }
- - - - -
name
{ "text": "string | undefined" }
The name of the icon to draw. Available names depend on the icon library being used.name - - -
library
{ "text": "string | undefined" }
The name of a registered custom icon library.library - - -
src
{ "text": "string | undefined" }
An external URL of an SVG file. Be sure you trust the content you are including, as it will be executed as code and can result in XSS attacks.src - - -
href
{ "text": "string | undefined" }
When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`.href - - -
target
{ "text": "'_blank' | '_parent' | '_self' | '_top' | undefined" }
Tells the browser where to open the link. Only used when `href` is set.target - - -
download
{ "text": "string | undefined" }
Tells the browser to download the linked file as this filename. Only used when `href` is set.download - - -
label
{ "text": "string" }
A description that gets read by assistive devices. For optimal accessibility, you should always include a label that describes what the icon button does.label'' - -
disabled
{ "text": "boolean" }
Disables the button.disabledfalse - true
Attributes
nametypedescriptionfieldNamedefault
name
{ "text": "string | undefined" }
The name of the icon to draw. Available names depend on the icon library being used.name -
library
{ "text": "string | undefined" }
The name of a registered custom icon library.library -
src
{ "text": "string | undefined" }
An external URL of an SVG file. Be sure you trust the content you are including, as it will be executed as code and can result in XSS attacks.src -
href
{ "text": "string | undefined" }
When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`.href -
target
{ "text": "'_blank' | '_parent' | '_self' | '_top' | undefined" }
Tells the browser where to open the link. Only used when `href` is set.target -
download
{ "text": "string | undefined" }
Tells the browser to download the linked file as this filename. Only used when `href` is set.download -
label
{ "text": "string" }
A description that gets read by assistive devices. For optimal accessibility, you should always include a label that describes what the icon button does.label''
disabled
{ "text": "boolean" }
Disables the button.disabledfalse
CSS Parts
namedescription
baseThe component's base wrapper.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the icon button loses focus.onSlBlurSlBlurEvent
sl-focusEmitted when the icon button gains focus.onSlFocusSlFocusEvent
Methods
namedescriptionparameters
clickSimulates a click on the icon button. -
focusSets focus on the icon button.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
blurRemoves focus from the icon button. -

sl-image-comparer

Properties
nametypedefaultstaticdescriptionattributereflects
scopedElement
{ "text": "object" }
{ 'sl-icon': SlIcon }true - - -
base
{ "text": "HTMLElement" }
- - - - -
handle
{ "text": "HTMLElement" }
- - - - -
position
{ "text": "number" }
50 - The position of the divider as a percentage.positiontrue
Attributes
nametypedefaultdescriptionfieldName
position
{ "text": "number" }
50The position of the divider as a percentage.position
CSS Properties
namedescription
--divider-widthThe width of the dividing line.
--handle-sizeThe size of the compare handle.
CSS Parts
namedescription
baseThe component's base wrapper.
beforeThe container that wraps the before image.
afterThe container that wraps the after image.
dividerThe divider that separates the images.
handleThe handle that the user drags to expose the after image.
Slots
namedescription
beforeThe before image, an `<img>` or `<svg>` element.
afterThe after image, an `<img>` or `<svg>` element.
handleThe icon used inside the handle.
Events
namedescriptionreactNameeventName
sl-changeEmitted when the position changes.onSlChangeSlChangeEvent
Methods
name
handlePositionChange

sl-include

Properties
nametypedescriptionattributedefault
src
{ "text": "string" }
The location of the HTML file to include. Be sure you trust the content you are including as it will be executed as code and can result in XSS attacks.src -
mode
{ "text": "'cors' | 'no-cors' | 'same-origin'" }
The fetch mode to use.mode'cors'
allowScripts
{ "text": "boolean" }
Allows included scripts to be executed. Be sure you trust the content you are including as it will be executed as code and can result in XSS attacks.allow-scriptsfalse
Attributes
nametypedescriptionfieldNamedefault
src
{ "text": "string" }
The location of the HTML file to include. Be sure you trust the content you are including as it will be executed as code and can result in XSS attacks.src -
mode
{ "text": "'cors' | 'no-cors' | 'same-origin'" }
The fetch mode to use.mode'cors'
allow-scripts
{ "text": "boolean" }
Allows included scripts to be executed. Be sure you trust the content you are including as it will be executed as code and can result in XSS attacks.allowScriptsfalse
Events
namedescriptionreactNameeventNametype
sl-loadEmitted when the included file is loaded.onSlLoadSlLoadEvent -
sl-errorEmitted when the included file fails to load due to an error.onSlErrorSlErrorEvent
{ "text": "{ status: number }" }
Methods
name
handleSrcChange

sl-input

Properties
namedescriptiontypeattributedefaultreflectsreadonlystatic
dependencies -
{ "text": "object" }
- { 'sl-icon': SlIcon } - - true
input -
{ "text": "HTMLInputElement" }
- - - - -
title -
{ "text": "string" }
title'' - - -
typeThe type of input. Works the same as a native `<input>` element, but only a subset of types are supported. Defaults to `text`.
{ "text": "| 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'time'\n | 'url'" }
type'text'true - -
nameThe name of the input, submitted as a name/value pair with form data.
{ "text": "string" }
name'' - - -
valueThe current value of the input, submitted as a name/value pair with form data.
{ "text": "string" }
value'' - - -
defaultValueThe default value of the form control. Primarily used for resetting the form control.
{ "text": "string" }
- '' - - -
sizeThe input's size.
{ "text": "'small' | 'medium' | 'large'" }
size'medium'true - -
filledDraws a filled input.
{ "text": "boolean" }
filledfalsetrue - -
pillDraws a pill-style input with rounded edges.
{ "text": "boolean" }
pillfalsetrue - -
labelThe input's label. If you need to display HTML, use the `label` slot instead.
{ "text": "string" }
label'' - - -
helpTextThe input's help text. If you need to display HTML, use the `help-text` slot instead.
{ "text": "string" }
help-text'' - - -
clearableAdds a clear button when the input is not empty.
{ "text": "boolean" }
clearablefalse - - -
disabledDisables the input.
{ "text": "boolean" }
disabledfalsetrue - -
placeholderPlaceholder text to show as a hint when the input is empty.
{ "text": "string" }
placeholder'' - - -
readonlyMakes the input readonly.
{ "text": "boolean" }
readonlyfalsetrue - -
passwordToggleAdds a button to toggle the password's visibility. Only applies to password types.
{ "text": "boolean" }
password-togglefalse - - -
passwordVisibleDetermines whether or not the password is currently visible. Only applies to password input types.
{ "text": "boolean" }
password-visiblefalse - - -
noSpinButtonsHides the browser's built-in increment/decrement spin buttons for number inputs.
{ "text": "boolean" }
no-spin-buttonsfalse - - -
formBy default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.
{ "text": "string" }
form''true - -
requiredMakes the input a required field.
{ "text": "boolean" }
requiredfalsetrue - -
patternA regular expression pattern to validate input against.
{ "text": "string" }
pattern - - - -
minlengthThe minimum length of input that will be considered valid.
{ "text": "number" }
minlength - - - -
maxlengthThe maximum length of input that will be considered valid.
{ "text": "number" }
maxlength - - - -
minThe input's minimum value. Only applies to date and number input types.
{ "text": "number | string" }
min - - - -
maxThe input's maximum value. Only applies to date and number input types.
{ "text": "number | string" }
max - - - -
stepSpecifies the granularity that the value must adhere to, or the special value `any` which means no stepping is implied, allowing any numeric value. Only applies to date and number input types.
{ "text": "number | 'any'" }
step - - - -
autocapitalizeControls whether and how text input is automatically capitalized as it is entered by the user.
{ "text": "'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'" }
autocapitalize - - - -
autocorrectIndicates whether the browser's autocorrect feature is on or off.
{ "text": "'off' | 'on'" }
autocorrect - - - -
autocompleteSpecifies what permission the browser has to provide assistance in filling out form field values. Refer to [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.
{ "text": "string" }
autocomplete - - - -
autofocusIndicates that the input should receive focus on page load.
{ "text": "boolean" }
autofocus - - - -
enterkeyhintUsed to customize the label or icon of the Enter key on virtual keyboards.
{ "text": "'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'" }
enterkeyhint - - - -
spellcheckEnables spell checking on the input.
{ "text": "boolean" }
spellchecktrue - - -
inputmodeTells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual keyboard on supportive devices.
{ "text": "'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'" }
inputmode - - - -
valueAsDateGets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. This will use the native `<input type="{{type}}">` implementation and may result in an error. - - - - - -
valueAsNumberGets or sets the current value as a number. Returns `NaN` if the value can't be converted. - - - - - -
validityGets the validity state object - - - - true -
validationMessageGets the validation message - - - - true -
Attributes
nametypefieldNamedescriptiondefault
title
{ "text": "string" }
title - ''
type
{ "text": "| 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'time'\n | 'url'" }
typeThe type of input. Works the same as a native `<input>` element, but only a subset of types are supported. Defaults to `text`.'text'
name
{ "text": "string" }
nameThe name of the input, submitted as a name/value pair with form data.''
value
{ "text": "string" }
valueThe current value of the input, submitted as a name/value pair with form data.''
size
{ "text": "'small' | 'medium' | 'large'" }
sizeThe input's size.'medium'
filled
{ "text": "boolean" }
filledDraws a filled input.false
pill
{ "text": "boolean" }
pillDraws a pill-style input with rounded edges.false
label
{ "text": "string" }
labelThe input's label. If you need to display HTML, use the `label` slot instead.''
help-text
{ "text": "string" }
helpTextThe input's help text. If you need to display HTML, use the `help-text` slot instead.''
clearable
{ "text": "boolean" }
clearableAdds a clear button when the input is not empty.false
disabled
{ "text": "boolean" }
disabledDisables the input.false
placeholder
{ "text": "string" }
placeholderPlaceholder text to show as a hint when the input is empty.''
readonly
{ "text": "boolean" }
readonlyMakes the input readonly.false
password-toggle
{ "text": "boolean" }
passwordToggleAdds a button to toggle the password's visibility. Only applies to password types.false
password-visible
{ "text": "boolean" }
passwordVisibleDetermines whether or not the password is currently visible. Only applies to password input types.false
no-spin-buttons
{ "text": "boolean" }
noSpinButtonsHides the browser's built-in increment/decrement spin buttons for number inputs.false
form
{ "text": "string" }
formBy default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.''
required
{ "text": "boolean" }
requiredMakes the input a required field.false
pattern
{ "text": "string" }
patternA regular expression pattern to validate input against. -
minlength
{ "text": "number" }
minlengthThe minimum length of input that will be considered valid. -
maxlength
{ "text": "number" }
maxlengthThe maximum length of input that will be considered valid. -
min
{ "text": "number | string" }
minThe input's minimum value. Only applies to date and number input types. -
max
{ "text": "number | string" }
maxThe input's maximum value. Only applies to date and number input types. -
step
{ "text": "number | 'any'" }
stepSpecifies the granularity that the value must adhere to, or the special value `any` which means no stepping is implied, allowing any numeric value. Only applies to date and number input types. -
autocapitalize
{ "text": "'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'" }
autocapitalizeControls whether and how text input is automatically capitalized as it is entered by the user. -
autocorrect
{ "text": "'off' | 'on'" }
autocorrectIndicates whether the browser's autocorrect feature is on or off. -
autocomplete
{ "text": "string" }
autocompleteSpecifies what permission the browser has to provide assistance in filling out form field values. Refer to [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values. -
autofocus
{ "text": "boolean" }
autofocusIndicates that the input should receive focus on page load. -
enterkeyhint
{ "text": "'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'" }
enterkeyhintUsed to customize the label or icon of the Enter key on virtual keyboards. -
spellcheck
{ "text": "boolean" }
spellcheckEnables spell checking on the input.true
inputmode
{ "text": "'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'" }
inputmodeTells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual keyboard on supportive devices. -
CSS Parts
namedescription
form-controlThe form control that wraps the label, input, and help text.
form-control-labelThe label's wrapper.
form-control-inputThe input's wrapper.
form-control-help-textThe help text's wrapper.
baseThe component's base wrapper.
inputThe internal `<input>` control.
prefixThe container that wraps the prefix.
clear-buttonThe clear button.
password-toggle-buttonThe password toggle button.
suffixThe container that wraps the suffix.
Slots
namedescription
labelThe input's label. Alternatively, you can use the `label` attribute.
prefixUsed to prepend a presentational icon or similar element to the input.
suffixUsed to append a presentational icon or similar element to the input.
clear-iconAn icon to use in lieu of the default clear icon.
show-password-iconAn icon to use in lieu of the default show password icon.
hide-password-iconAn icon to use in lieu of the default hide password icon.
help-textText that describes how to use the input. Alternatively, you can use the `help-text` attribute.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the control loses focus.onSlBlurSlBlurEvent
sl-changeEmitted when an alteration to the control's value is committed by the user.onSlChangeSlChangeEvent
sl-clearEmitted when the clear button is activated.onSlClearSlClearEvent
sl-focusEmitted when the control gains focus.onSlFocusSlFocusEvent
sl-inputEmitted when the control receives input.onSlInputSlInputEvent
sl-invalidEmitted when the form control has been checked for validity and its constraints aren't satisfied.onSlInvalidSlInvalidEvent
Methods
namedescriptionparametersreturn
handleDisabledChange - - -
handleStepChange - - -
handleValueChange - - -
focusSets focus on the input.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
-
blurRemoves focus from the input. - -
selectSelects all the text in the input. - -
setSelectionRangeSets the start and end positions of the text selection (0-based).
parameters
nametypedefault
selectionStart
{ "text": "number" }
-
selectionEnd
{ "text": "number" }
-
selectionDirection
{ "text": "'forward' | 'backward' | 'none'" }
'none'
-
setRangeTextReplaces a range of text with a new string.
parameters
nametypeoptionaldefault
replacement
{ "text": "string" }
- -
start
{ "text": "number" }
true -
end
{ "text": "number" }
true -
selectMode
{ "text": "'select' | 'start' | 'end' | 'preserve'" }
- 'preserve'
-
showPickerDisplays the browser picker for an input element (only works if the browser supports it for the input type). - -
stepUpIncrements the value of a numeric input type by the value of the step attribute. - -
stepDownDecrements the value of a numeric input type by the value of the step attribute. - -
checkValidityChecks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. - -
getFormGets the associated form, if one exists. -
{ "type": { "text": "HTMLFormElement | null" } }
reportValidityChecks for validity and shows the browser's validation message if the control is invalid. - -
setCustomValiditySets a custom validation message. Pass an empty string to restore validity.
parameters
nametype
message
{ "text": "string" }
-

sl-menu

Properties
nametype
defaultSlot
{ "text": "HTMLSlotElement" }
Slots
namedescription
The menu's content, including menu items, menu labels, and dividers.
Events
nametypedescriptionreactNameeventName
sl-select
{ "text": "{ item: SlMenuItem }" }
Emitted when a menu item is selected.onSlSelectSlSelectEvent

sl-menu-item

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon, 'sl-popup': SlPopup, 'sl-spinner': SlSpinner } - - - true
defaultSlot
{ "text": "HTMLSlotElement" }
- - - - -
menuItem
{ "text": "HTMLElement" }
- - - - -
type
{ "text": "'normal' | 'checkbox'" }
'normal'The type of menu item to render. To use `checked`, this value must be set to `checkbox`.type - -
checked
{ "text": "boolean" }
falseDraws the item in a checked state.checkedtrue -
value
{ "text": "string" }
''A unique value to store in the menu item. This can be used as a way to identify menu items when selected.value - -
loading
{ "text": "boolean" }
falseDraws the menu item in a loading state.loadingtrue -
disabled
{ "text": "boolean" }
falseDraws the menu item in a disabled state, preventing selection.disabledtrue -
Attributes
nametypedefaultdescriptionfieldName
type
{ "text": "'normal' | 'checkbox'" }
'normal'The type of menu item to render. To use `checked`, this value must be set to `checkbox`.type
checked
{ "text": "boolean" }
falseDraws the item in a checked state.checked
value
{ "text": "string" }
''A unique value to store in the menu item. This can be used as a way to identify menu items when selected.value
loading
{ "text": "boolean" }
falseDraws the menu item in a loading state.loading
disabled
{ "text": "boolean" }
falseDraws the menu item in a disabled state, preventing selection.disabled
CSS Properties
namedescriptiondefault
--submenu-offsetThe distance submenus shift to overlap the parent menu.-2px
CSS Parts
namedescription
baseThe component's base wrapper.
checked-iconThe checked icon, which is only visible when the menu item is checked.
prefixThe prefix container.
labelThe menu item label.
suffixThe suffix container.
spinnerThe spinner that shows when the menu item is in the loading state.
spinner__baseThe spinner's base part.
submenu-iconThe submenu icon, visible only when the menu item has a submenu (not yet implemented).
Slots
namedescription
The menu item's label.
prefixUsed to prepend an icon or similar element to the menu item.
suffixUsed to append an icon or similar element to the menu item.
submenuUsed to denote a nested menu.
Methods
namedescription
handleCheckedChange -
handleDisabledChange -
handleTypeChange -
getTextLabelReturns a text label based on the contents of the menu item's default slot.
isSubmenu -

sl-menu-label

CSS Parts
namedescription
baseThe component's base wrapper.
Slots
namedescription
The menu label's content.

sl-mutation-observer

Properties
nametypedescriptionattributereflectsdefault
attr
{ "text": "string" }
Watches for changes to attributes. To watch only specific attributes, separate them by a space, e.g. `attr="class id title"`. To watch all attributes, use `*`.attrtrue -
attrOldValue
{ "text": "boolean" }
Indicates whether or not the attribute's previous value should be recorded when monitoring changes.attr-old-valuetruefalse
charData
{ "text": "boolean" }
Watches for changes to the character data contained within the node.char-datatruefalse
charDataOldValue
{ "text": "boolean" }
Indicates whether or not the previous value of the node's text should be recorded.char-data-old-valuetruefalse
childList
{ "text": "boolean" }
Watches for the addition or removal of new child nodes.child-listtruefalse
disabled
{ "text": "boolean" }
Disables the observer.disabledtruefalse
Attributes
nametypedescriptionfieldNamedefault
attr
{ "text": "string" }
Watches for changes to attributes. To watch only specific attributes, separate them by a space, e.g. `attr="class id title"`. To watch all attributes, use `*`.attr -
attr-old-value
{ "text": "boolean" }
Indicates whether or not the attribute's previous value should be recorded when monitoring changes.attrOldValuefalse
char-data
{ "text": "boolean" }
Watches for changes to the character data contained within the node.charDatafalse
char-data-old-value
{ "text": "boolean" }
Indicates whether or not the previous value of the node's text should be recorded.charDataOldValuefalse
child-list
{ "text": "boolean" }
Watches for the addition or removal of new child nodes.childListfalse
disabled
{ "text": "boolean" }
Disables the observer.disabledfalse
Slots
namedescription
The content to watch for mutations.
Events
nametypedescriptionreactNameeventName
sl-mutation
{ "text": "{ mutationList: MutationRecord[] }" }
Emitted when a mutation occurs.onSlMutationSlMutationEvent
Methods
name
handleDisabledChange
handleChange

sl-option

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon } - - - true
defaultSlot
{ "text": "HTMLSlotElement" }
- - - - -
current
{ "text": "boolean" }
false - - - -
selected
{ "text": "boolean" }
false - - - -
hasHover
{ "text": "boolean" }
false - - - -
value
{ "text": "string" }
''The option's value. When selected, the containing form control will receive this value. The value must be unique from other options in the same group. Values may not contain spaces, as spaces are used as delimiters when listing multiple values.valuetrue -
disabled
{ "text": "boolean" }
falseDraws the option in a disabled state, preventing selection.disabledtrue -
Attributes
nametypedefaultdescriptionfieldName
value
{ "text": "string" }
''The option's value. When selected, the containing form control will receive this value. The value must be unique from other options in the same group. Values may not contain spaces, as spaces are used as delimiters when listing multiple values.value
disabled
{ "text": "boolean" }
falseDraws the option in a disabled state, preventing selection.disabled
CSS Parts
namedescription
checked-iconThe checked icon, an `<sl-icon>` element.
baseThe component's base wrapper.
labelThe option's label.
prefixThe container that wraps the prefix.
suffixThe container that wraps the suffix.
Slots
namedescription
The option's label.
prefixUsed to prepend an icon or similar element to the menu item.
suffixUsed to append an icon or similar element to the menu item.
Methods
namedescription
handleDisabledChange -
handleSelectedChange -
handleValueChange -
getTextLabelReturns a plain text label based on the option's content.

sl-popup

Properties
nametypedescriptionattributedefaultreflects
popup
{ "text": "HTMLElement" }
A reference to the internal popup container. Useful for animating and styling the popup with JavaScript. - - -
anchor
{ "text": "Element | string | VirtualElement" }
The element the popup will be anchored to. If the anchor lives outside of the popup, you can provide the anchor element `id`, a DOM element reference, or a `VirtualElement`. If the anchor lives inside the popup, use the `anchor` slot instead.anchor - -
active
{ "text": "boolean" }
Activates the positioning logic and shows the popup. When this attribute is removed, the positioning logic is torn down and the popup will be hidden.activefalsetrue
placement
{ "text": "| 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end'" }
The preferred placement of the popup. Note that the actual placement will vary as configured to keep the panel inside of the viewport.placement'top'true
strategy
{ "text": "'absolute' | 'fixed'" }
Determines how the popup is positioned. The `absolute` strategy works well in most cases, but if overflow is clipped, using a `fixed` position strategy can often workaround it.strategy'absolute'true
distance
{ "text": "number" }
The distance in pixels from which to offset the panel away from its anchor.distance0 -
skidding
{ "text": "number" }
The distance in pixels from which to offset the panel along its anchor.skidding0 -
arrow
{ "text": "boolean" }
Attaches an arrow to the popup. The arrow's size and color can be customized using the `--arrow-size` and `--arrow-color` custom properties. For additional customizations, you can also target the arrow using `::part(arrow)` in your stylesheet.arrowfalse -
arrowPlacement
{ "text": "'start' | 'end' | 'center' | 'anchor'" }
The placement of the arrow. The default is `anchor`, which will align the arrow as close to the center of the anchor as possible, considering available space and `arrow-padding`. A value of `start`, `end`, or `center` will align the arrow to the start, end, or center of the popover instead.arrow-placement'anchor' -
arrowPadding
{ "text": "number" }
The amount of padding between the arrow and the edges of the popup. If the popup has a border-radius, for example, this will prevent it from overflowing the corners.arrow-padding10 -
flip
{ "text": "boolean" }
When set, placement of the popup will flip to the opposite site to keep it in view. You can use `flipFallbackPlacements` to further configure how the fallback placement is determined.flipfalse -
flipFallbackPlacements
{ "text": "string" }
If the preferred placement doesn't fit, popup will be tested in these fallback placements until one fits. Must be a string of any number of placements separated by a space, e.g. "top bottom left". If no placement fits, the flip fallback strategy will be used instead.flip-fallback-placements'' -
flipFallbackStrategy
{ "text": "'best-fit' | 'initial'" }
When neither the preferred placement nor the fallback placements fit, this value will be used to determine whether the popup should be positioned using the best available fit based on available space or as it was initially preferred.flip-fallback-strategy'best-fit' -
flipBoundary
{ "text": "Element | Element[]" }
The flip boundary describes clipping element(s) that overflow will be checked relative to when flipping. By default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can change the boundary by passing a reference to one or more elements to this property.flipBoundary - -
flipPadding
{ "text": "number" }
The amount of padding, in pixels, to exceed before the flip behavior will occur.flip-padding0 -
shift
{ "text": "boolean" }
Moves the popup along the axis to keep it in view when clipped.shiftfalse -
shiftBoundary
{ "text": "Element | Element[]" }
The shift boundary describes clipping element(s) that overflow will be checked relative to when shifting. By default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can change the boundary by passing a reference to one or more elements to this property.shiftBoundary - -
shiftPadding
{ "text": "number" }
The amount of padding, in pixels, to exceed before the shift behavior will occur.shift-padding0 -
autoSize
{ "text": "'horizontal' | 'vertical' | 'both'" }
When set, this will cause the popup to automatically resize itself to prevent it from overflowing.auto-size - -
sync
{ "text": "'width' | 'height' | 'both'" }
Syncs the popup's width or height to that of the anchor element.sync - -
autoSizeBoundary
{ "text": "Element | Element[]" }
The auto-size boundary describes clipping element(s) that overflow will be checked relative to when resizing. By default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can change the boundary by passing a reference to one or more elements to this property.autoSizeBoundary - -
autoSizePadding
{ "text": "number" }
The amount of padding, in pixels, to exceed before the auto-size behavior will occur.auto-size-padding0 -
hoverBridge
{ "text": "boolean" }
When a gap exists between the anchor and the popup element, this option will add a "hover bridge" that fills the gap using an invisible element. This makes listening for events such as `mouseenter` and `mouseleave` more sane because the pointer never technically leaves the element. The hover bridge will only be drawn when the popover is active.hover-bridgefalse -
Attributes
nametypedescriptionfieldNamedefault
anchor
{ "text": "Element | string | VirtualElement" }
The element the popup will be anchored to. If the anchor lives outside of the popup, you can provide the anchor element `id`, a DOM element reference, or a `VirtualElement`. If the anchor lives inside the popup, use the `anchor` slot instead.anchor -
active
{ "text": "boolean" }
Activates the positioning logic and shows the popup. When this attribute is removed, the positioning logic is torn down and the popup will be hidden.activefalse
placement
{ "text": "| 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end'" }
The preferred placement of the popup. Note that the actual placement will vary as configured to keep the panel inside of the viewport.placement'top'
strategy
{ "text": "'absolute' | 'fixed'" }
Determines how the popup is positioned. The `absolute` strategy works well in most cases, but if overflow is clipped, using a `fixed` position strategy can often workaround it.strategy'absolute'
distance
{ "text": "number" }
The distance in pixels from which to offset the panel away from its anchor.distance0
skidding
{ "text": "number" }
The distance in pixels from which to offset the panel along its anchor.skidding0
arrow
{ "text": "boolean" }
Attaches an arrow to the popup. The arrow's size and color can be customized using the `--arrow-size` and `--arrow-color` custom properties. For additional customizations, you can also target the arrow using `::part(arrow)` in your stylesheet.arrowfalse
arrow-placement
{ "text": "'start' | 'end' | 'center' | 'anchor'" }
The placement of the arrow. The default is `anchor`, which will align the arrow as close to the center of the anchor as possible, considering available space and `arrow-padding`. A value of `start`, `end`, or `center` will align the arrow to the start, end, or center of the popover instead.arrowPlacement'anchor'
arrow-padding
{ "text": "number" }
The amount of padding between the arrow and the edges of the popup. If the popup has a border-radius, for example, this will prevent it from overflowing the corners.arrowPadding10
flip
{ "text": "boolean" }
When set, placement of the popup will flip to the opposite site to keep it in view. You can use `flipFallbackPlacements` to further configure how the fallback placement is determined.flipfalse
flip-fallback-placements
{ "text": "string" }
If the preferred placement doesn't fit, popup will be tested in these fallback placements until one fits. Must be a string of any number of placements separated by a space, e.g. "top bottom left". If no placement fits, the flip fallback strategy will be used instead.flipFallbackPlacements''
flip-fallback-strategy
{ "text": "'best-fit' | 'initial'" }
When neither the preferred placement nor the fallback placements fit, this value will be used to determine whether the popup should be positioned using the best available fit based on available space or as it was initially preferred.flipFallbackStrategy'best-fit'
flipBoundary
{ "text": "Element | Element[]" }
The flip boundary describes clipping element(s) that overflow will be checked relative to when flipping. By default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can change the boundary by passing a reference to one or more elements to this property.flipBoundary -
flip-padding
{ "text": "number" }
The amount of padding, in pixels, to exceed before the flip behavior will occur.flipPadding0
shift
{ "text": "boolean" }
Moves the popup along the axis to keep it in view when clipped.shiftfalse
shiftBoundary
{ "text": "Element | Element[]" }
The shift boundary describes clipping element(s) that overflow will be checked relative to when shifting. By default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can change the boundary by passing a reference to one or more elements to this property.shiftBoundary -
shift-padding
{ "text": "number" }
The amount of padding, in pixels, to exceed before the shift behavior will occur.shiftPadding0
auto-size
{ "text": "'horizontal' | 'vertical' | 'both'" }
When set, this will cause the popup to automatically resize itself to prevent it from overflowing.autoSize -
sync
{ "text": "'width' | 'height' | 'both'" }
Syncs the popup's width or height to that of the anchor element.sync -
autoSizeBoundary
{ "text": "Element | Element[]" }
The auto-size boundary describes clipping element(s) that overflow will be checked relative to when resizing. By default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can change the boundary by passing a reference to one or more elements to this property.autoSizeBoundary -
auto-size-padding
{ "text": "number" }
The amount of padding, in pixels, to exceed before the auto-size behavior will occur.autoSizePadding0
hover-bridge
{ "text": "boolean" }
When a gap exists between the anchor and the popup element, this option will add a "hover bridge" that fills the gap using an invisible element. This makes listening for events such as `mouseenter` and `mouseleave` more sane because the pointer never technically leaves the element. The hover bridge will only be drawn when the popover is active.hoverBridgefalse
CSS Properties
namedescriptiondefault
--arrow-sizeThe size of the arrow. Note that an arrow won't be shown unless the `arrow` attribute is used.6px
--arrow-colorThe color of the arrow.var(--sl-color-neutral-0)
--auto-size-available-widthA read-only custom property that determines the amount of width the popup can be before overflowing. Useful for positioning child elements that need to overflow. This property is only available when using `auto-size`. -
--auto-size-available-heightA read-only custom property that determines the amount of height the popup can be before overflowing. Useful for positioning child elements that need to overflow. This property is only available when using `auto-size`. -
CSS Parts
namedescription
arrowThe arrow's container. Avoid setting `top|bottom|left|right` properties, as these values are assigned dynamically as the popup moves. This is most useful for applying a background color to match the popup, and maybe a border or box shadow.
popupThe popup's container. Useful for setting a background color, box shadow, etc.
hover-bridgeThe hover bridge element. Only available when the `hover-bridge` option is enabled.
Slots
namedescription
The popup's content.
anchorThe element the popup will be anchored to. If the anchor lives outside of the popup, you can use the `anchor` attribute or property instead.
Events
namedescriptionreactNameeventName
sl-repositionEmitted when the popup is repositioned. This event can fire a lot, so avoid putting expensive operations in your listener or consider debouncing it.onSlRepositionSlRepositionEvent
Methods
namedescription
repositionForces the popup to recalculate and reposition itself.

sl-progress-bar

Properties
nametypedefaultdescriptionattributereflects
value
{ "text": "number" }
0The current progress as a percentage, 0 to 100.valuetrue
indeterminate
{ "text": "boolean" }
falseWhen true, percentage is ignored, the label is hidden, and the progress bar is drawn in an indeterminate state.indeterminatetrue
label
{ "text": "string" }
''A custom label for assistive devices.label -
Attributes
nametypedefaultdescriptionfieldName
value
{ "text": "number" }
0The current progress as a percentage, 0 to 100.value
indeterminate
{ "text": "boolean" }
falseWhen true, percentage is ignored, the label is hidden, and the progress bar is drawn in an indeterminate state.indeterminate
label
{ "text": "string" }
''A custom label for assistive devices.label
CSS Properties
namedescription
--heightThe progress bar's height.
--track-colorThe color of the track.
--indicator-colorThe color of the indicator.
--label-colorThe color of the label.
CSS Parts
namedescription
baseThe component's base wrapper.
indicatorThe progress bar's indicator.
labelThe progress bar's label.
Slots
namedescription
A label to show inside the progress indicator.

sl-progress-ring

Properties
nametypedefaultdescriptionattributereflects
indicator
{ "text": "SVGCircleElement" }
- - - -
indicatorOffset
{ "text": "string" }
- - - -
value
{ "text": "number" }
0The current progress as a percentage, 0 to 100.valuetrue
label
{ "text": "string" }
''A custom label for assistive devices.label -
Attributes
nametypedefaultdescriptionfieldName
value
{ "text": "number" }
0The current progress as a percentage, 0 to 100.value
label
{ "text": "string" }
''A custom label for assistive devices.label
CSS Properties
namedescription
--sizeThe diameter of the progress ring (cannot be a percentage).
--track-widthThe width of the track.
--track-colorThe color of the track.
--indicator-widthThe width of the indicator. Defaults to the track width.
--indicator-colorThe color of the indicator.
--indicator-transition-durationThe duration of the indicator's transition when the value changes.
CSS Parts
namedescription
baseThe component's base wrapper.
labelThe progress ring label.
Slots
namedescription
A label to show inside the ring.

sl-radio

Properties
nametypedefaultdescriptionattributereflectsstaticprivacy
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon } - - - true -
checked
{ "text": "boolean" }
false - - - - -
hasFocus
{ "text": "boolean" }
false - - - - protected
value
{ "text": "string" }
- The radio's value. When selected, the radio group will receive this value.value - - -
size
{ "text": "'small' | 'medium' | 'large'" }
'medium'The radio's size. When used inside a radio group, the size will be determined by the radio group's size so this attribute can typically be omitted.sizetrue - -
disabled
{ "text": "boolean" }
falseDisables the radio.disabledtrue - -
Attributes
nametypedescriptionfieldNamedefault
value
{ "text": "string" }
The radio's value. When selected, the radio group will receive this value.value -
size
{ "text": "'small' | 'medium' | 'large'" }
The radio's size. When used inside a radio group, the size will be determined by the radio group's size so this attribute can typically be omitted.size'medium'
disabled
{ "text": "boolean" }
Disables the radio.disabledfalse
CSS Parts
namedescription
baseThe component's base wrapper.
controlThe circular container that wraps the radio's checked state.
control--checkedThe radio control when the radio is checked.
checked-iconThe checked icon, an `<sl-icon>` element.
labelThe container that wraps the radio's label.
Slots
namedescription
The radio's label.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the control loses focus.onSlBlurSlBlurEvent
sl-focusEmitted when the control gains focus.onSlFocusSlFocusEvent
Methods
name
handleCheckedChange
handleDisabledChange

sl-qr-code

Properties
nametypedefaultdescriptionattribute
canvas
{ "text": "HTMLElement" }
- - -
value
{ "text": "string" }
''The QR code's value.value
label
{ "text": "string" }
''The label for assistive devices to announce. If unspecified, the value will be used instead.label
size
{ "text": "number" }
128The size of the QR code, in pixels.size
fill
{ "text": "string" }
'black'The fill color. This can be any valid CSS color, but not a CSS custom property.fill
background
{ "text": "string" }
'white'The background color. This can be any valid CSS color or `transparent`. It cannot be a CSS custom property.background
radius
{ "text": "number" }
0The edge radius of each module. Must be between 0 and 0.5.radius
errorCorrection
{ "text": "'L' | 'M' | 'Q' | 'H'" }
'H'The level of error correction to use. [Learn more](https://www.qrcode.com/en/about/error_correction.html)error-correction
Attributes
nametypedefaultdescriptionfieldName
value
{ "text": "string" }
''The QR code's value.value
label
{ "text": "string" }
''The label for assistive devices to announce. If unspecified, the value will be used instead.label
size
{ "text": "number" }
128The size of the QR code, in pixels.size
fill
{ "text": "string" }
'black'The fill color. This can be any valid CSS color, but not a CSS custom property.fill
background
{ "text": "string" }
'white'The background color. This can be any valid CSS color or `transparent`. It cannot be a CSS custom property.background
radius
{ "text": "number" }
0The edge radius of each module. Must be between 0 and 0.5.radius
error-correction
{ "text": "'L' | 'M' | 'Q' | 'H'" }
'H'The level of error correction to use. [Learn more](https://www.qrcode.com/en/about/error_correction.html)errorCorrection
CSS Parts
namedescription
baseThe component's base wrapper.
Methods
name
generate

sl-radio-button

Properties
nametypedefaultdescriptionattributereflectsprivacy
input
{ "text": "HTMLInputElement" }
- - - - -
hiddenInput
{ "text": "HTMLInputElement" }
- - - - -
hasFocus
{ "text": "boolean" }
false - - - protected
value
{ "text": "string" }
- The radio's value. When selected, the radio group will receive this value.value - -
disabled
{ "text": "boolean" }
falseDisables the radio button.disabledtrue -
size
{ "text": "'small' | 'medium' | 'large'" }
'medium'The radio button's size. When used inside a radio group, the size will be determined by the radio group's size so this attribute can typically be omitted.sizetrue -
pill
{ "text": "boolean" }
falseDraws a pill-style radio button with rounded edges.pilltrue -
Attributes
nametypedescriptionfieldNamedefault
value
{ "text": "string" }
The radio's value. When selected, the radio group will receive this value.value -
disabled
{ "text": "boolean" }
Disables the radio button.disabledfalse
size
{ "text": "'small' | 'medium' | 'large'" }
The radio button's size. When used inside a radio group, the size will be determined by the radio group's size so this attribute can typically be omitted.size'medium'
pill
{ "text": "boolean" }
Draws a pill-style radio button with rounded edges.pillfalse
CSS Parts
namedescription
baseThe component's base wrapper.
buttonThe internal `<button>` element.
button--checkedThe internal button element when the radio button is checked.
prefixThe container that wraps the prefix.
labelThe container that wraps the radio button's label.
suffixThe container that wraps the suffix.
Slots
namedescription
The radio button's label.
prefixA presentational prefix icon or similar element.
suffixA presentational suffix icon or similar element.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the button loses focus.onSlBlurSlBlurEvent
sl-focusEmitted when the button gains focus.onSlFocusSlFocusEvent
Methods
namedescriptionparameters
handleDisabledChange - -
focusSets focus on the radio button.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
blurRemoves focus from the radio button. -

sl-radio-group

Properties
nametypedefaultdescriptionattributereflectsreadonlystaticprivacy
dependencies
{ "text": "object" }
{ 'sl-button-group': SlButtonGroup } - - - - true -
formControlController - new FormControlController(this) - - - true - protected
defaultSlot
{ "text": "HTMLSlotElement" }
- - - - - - -
validationInput
{ "text": "HTMLInputElement" }
- - - - - - -
defaultValue
{ "text": "string" }
'' - - - - - -
label
{ "text": "string" }
''The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot instead.label - - - -
helpText
{ "text": "string" }
''The radio groups's help text. If you need to display HTML, use the `help-text` slot instead.help-text - - - -
name
{ "text": "string" }
'option'The name of the radio group, submitted as a name/value pair with form data.name - - - -
value
{ "text": "string" }
''The current value of the radio group, submitted as a name/value pair with form data.valuetrue - - -
size
{ "text": "'small' | 'medium' | 'large'" }
'medium'The radio group's size. This size will be applied to all child radios and radio buttons.sizetrue - - -
form
{ "text": "string" }
''By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.formtrue - - -
required
{ "text": "boolean" }
falseEnsures a child radio is checked before allowing the containing form to submit.requiredtrue - - -
validity - - Gets the validity state object - - true - -
validationMessage - - Gets the validation message - - true - -
Attributes
nametypedefaultdescriptionfieldName
label
{ "text": "string" }
''The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot instead.label
help-text
{ "text": "string" }
''The radio groups's help text. If you need to display HTML, use the `help-text` slot instead.helpText
name
{ "text": "string" }
'option'The name of the radio group, submitted as a name/value pair with form data.name
value
{ "text": "string" }
''The current value of the radio group, submitted as a name/value pair with form data.value
size
{ "text": "'small' | 'medium' | 'large'" }
'medium'The radio group's size. This size will be applied to all child radios and radio buttons.size
form
{ "text": "string" }
''By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.form
required
{ "text": "boolean" }
falseEnsures a child radio is checked before allowing the containing form to submit.required
CSS Parts
namedescription
form-controlThe form control that wraps the label, input, and help text.
form-control-labelThe label's wrapper.
form-control-inputThe input's wrapper.
form-control-help-textThe help text's wrapper.
button-groupThe button group that wraps radio buttons.
button-group__baseThe button group's `base` part.
Slots
namedescription
The default slot where `<sl-radio>` or `<sl-radio-button>` elements are placed.
labelThe radio group's label. Required for proper accessibility. Alternatively, you can use the `label` attribute.
help-textText that describes how to use the radio group. Alternatively, you can use the `help-text` attribute.
Events
namedescriptionreactNameeventName
sl-changeEmitted when the radio group's selected value changes.onSlChangeSlChangeEvent
sl-inputEmitted when the radio group receives user input.onSlInputSlInputEvent
sl-invalidEmitted when the form control has been checked for validity and its constraints aren't satisfied.onSlInvalidSlInvalidEvent
Methods
namedescriptionreturnparameters
handleSizeChange - - -
handleValueChange - - -
checkValidityChecks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. - -
getFormGets the associated form, if one exists.
{ "type": { "text": "HTMLFormElement | null" } }
-
reportValidityChecks for validity and shows the browser's validation message if the control is invalid.
{ "type": { "text": "boolean" } }
-
setCustomValiditySets a custom validation message. Pass an empty string to restore validity. -
parameters
namedefault
message''

sl-range

Properties
nametypedescriptiondefaultattributereflectsreadonly
input
{ "text": "HTMLInputElement" }
- - - - -
output
{ "text": "HTMLOutputElement | null" }
- - - - -
title
{ "text": "string" }
- ''title - -
name
{ "text": "string" }
The name of the range, submitted as a name/value pair with form data.''name - -
value
{ "text": "number" }
The current value of the range, submitted as a name/value pair with form data.0value - -
label
{ "text": "string" }
The range's label. If you need to display HTML, use the `label` slot instead.''label - -
helpText
{ "text": "string" }
The range's help text. If you need to display HTML, use the help-text slot instead.''help-text - -
disabled
{ "text": "boolean" }
Disables the range.falsedisabledtrue -
min
{ "text": "number" }
The minimum acceptable value of the range.0min - -
max
{ "text": "number" }
The maximum acceptable value of the range.100max - -
step
{ "text": "number" }
The interval at which the range will increase and decrease.1step - -
tooltip
{ "text": "'top' | 'bottom' | 'none'" }
The preferred placement of the range's tooltip.'top'tooltip - -
tooltipFormatter
{ "text": "(value: number) => string" }
A function used to format the tooltip's value. The range's value is passed as the first and only argument. The function should return a string to display in the tooltip. - - - -
form
{ "text": "string" }
By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.''formtrue -
defaultValue
{ "text": "number" }
The default value of the form control. Primarily used for resetting the form control.0 - - -
validity - Gets the validity state object - - - true
validationMessage - Gets the validation message - - - true
Attributes
nametypedefaultfieldNamedescription
title
{ "text": "string" }
''title -
name
{ "text": "string" }
''nameThe name of the range, submitted as a name/value pair with form data.
value
{ "text": "number" }
0valueThe current value of the range, submitted as a name/value pair with form data.
label
{ "text": "string" }
''labelThe range's label. If you need to display HTML, use the `label` slot instead.
help-text
{ "text": "string" }
''helpTextThe range's help text. If you need to display HTML, use the help-text slot instead.
disabled
{ "text": "boolean" }
falsedisabledDisables the range.
min
{ "text": "number" }
0minThe minimum acceptable value of the range.
max
{ "text": "number" }
100maxThe maximum acceptable value of the range.
step
{ "text": "number" }
1stepThe interval at which the range will increase and decrease.
tooltip
{ "text": "'top' | 'bottom' | 'none'" }
'top'tooltipThe preferred placement of the range's tooltip.
form
{ "text": "string" }
''formBy default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.
CSS Properties
namedescription
--thumb-sizeThe size of the thumb.
--tooltip-offsetThe vertical distance the tooltip is offset from the track.
--track-color-activeThe color of the portion of the track that represents the current value.
--track-color-inactiveThe of the portion of the track that represents the remaining value.
--track-heightThe height of the track.
--track-active-offsetThe point of origin of the active track.
CSS Parts
namedescription
form-controlThe form control that wraps the label, input, and help text.
form-control-labelThe label's wrapper.
form-control-inputThe range's wrapper.
form-control-help-textThe help text's wrapper.
baseThe component's base wrapper.
inputThe internal `<input>` element.
tooltipThe range's tooltip.
Slots
namedescription
labelThe range's label. Alternatively, you can use the `label` attribute.
help-textText that describes how to use the input. Alternatively, you can use the `help-text` attribute.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the control loses focus.onSlBlurSlBlurEvent
sl-changeEmitted when an alteration to the control's value is committed by the user.onSlChangeSlChangeEvent
sl-focusEmitted when the control gains focus.onSlFocusSlFocusEvent
sl-inputEmitted when the control receives input.onSlInputSlInputEvent
sl-invalidEmitted when the form control has been checked for validity and its constraints aren't satisfied.onSlInvalidSlInvalidEvent
Methods
namedescriptionparametersreturn
handleValueChange - - -
handleDisabledChange - - -
syncRange - - -
focusSets focus on the range.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
-
blurRemoves focus from the range. - -
stepUpIncrements the value of the range by the value of the step attribute. - -
stepDownDecrements the value of the range by the value of the step attribute. - -
checkValidityChecks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. - -
getFormGets the associated form, if one exists. -
{ "type": { "text": "HTMLFormElement | null" } }
reportValidityChecks for validity and shows the browser's validation message if the control is invalid. - -
setCustomValiditySets a custom validation message. Pass an empty string to restore validity.
parameters
nametype
message
{ "text": "string" }
-

sl-rating

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon } - - - true
rating
{ "text": "HTMLElement" }
- - - - -
label
{ "text": "string" }
''A label that describes the rating to assistive devices.label - -
value
{ "text": "number" }
0The current rating.value - -
max
{ "text": "number" }
5The highest rating to show.max - -
precision
{ "text": "number" }
1The precision at which the rating will increase and decrease. For example, to allow half-star ratings, set this attribute to `0.5`.precision - -
readonly
{ "text": "boolean" }
falseMakes the rating readonly.readonlytrue -
disabled
{ "text": "boolean" }
falseDisables the rating.disabledtrue -
getSymbol
{ "text": "(value: number) => string" }
- A function that customizes the symbol to be rendered. The first and only argument is the rating's current value. The function should return a string containing trusted HTML of the symbol to render at the specified value. Works well with `<sl-icon>` elements.getSymbol - -
Attributes
nametypedescriptionfieldNamedefault
label
{ "text": "string" }
A label that describes the rating to assistive devices.label''
value
{ "text": "number" }
The current rating.value0
max
{ "text": "number" }
The highest rating to show.max5
precision
{ "text": "number" }
The precision at which the rating will increase and decrease. For example, to allow half-star ratings, set this attribute to `0.5`.precision1
readonly
{ "text": "boolean" }
Makes the rating readonly.readonlyfalse
disabled
{ "text": "boolean" }
Disables the rating.disabledfalse
getSymbol
{ "text": "(value: number) => string" }
A function that customizes the symbol to be rendered. The first and only argument is the rating's current value. The function should return a string containing trusted HTML of the symbol to render at the specified value. Works well with `<sl-icon>` elements.getSymbol -
CSS Properties
namedescription
--symbol-colorThe inactive color for symbols.
--symbol-color-activeThe active color for symbols.
--symbol-sizeThe size of symbols.
--symbol-spacingThe spacing to use around symbols.
CSS Parts
namedescription
baseThe component's base wrapper.
Events
namedescriptionreactNameeventNametype
sl-changeEmitted when the rating's value changes.onSlChangeSlChangeEvent -
sl-hoverEmitted when the user hovers over a value. The `phase` property indicates when hovering starts, moves to a new value, or ends. The `value` property tells what the rating's value would be if the user were to commit to the hovered value.onSlHoverSlHoverEvent
{ "text": "{ phase: 'start' | 'move' | 'end', value: number }" }
Methods
namedescriptionparameters
handleHoverValueChange - -
handleIsHoveringChange - -
focusSets focus on the rating.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
blurRemoves focus from the rating. -

sl-relative-time

Properties
nametypedefaultdescriptionattribute
date
{ "text": "Date | string" }
new Date()The date from which to calculate time from. If not set, the current date and time will be used. When passing a string, it's strongly recommended to use the ISO 8601 format to ensure timezones are handled correctly. To convert a date to this format in JavaScript, use [`date.toISOString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString).date
format
{ "text": "'long' | 'short' | 'narrow'" }
'long'The formatting style to use.format
numeric
{ "text": "'always' | 'auto'" }
'auto'When `auto`, values such as "yesterday" and "tomorrow" will be shown when possible. When `always`, values such as "1 day ago" and "in 1 day" will be shown.numeric
sync
{ "text": "boolean" }
falseKeep the displayed value up to date as time passes.sync
Attributes
nametypedefaultdescriptionfieldName
date
{ "text": "Date | string" }
new Date()The date from which to calculate time from. If not set, the current date and time will be used. When passing a string, it's strongly recommended to use the ISO 8601 format to ensure timezones are handled correctly. To convert a date to this format in JavaScript, use [`date.toISOString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString).date
format
{ "text": "'long' | 'short' | 'narrow'" }
'long'The formatting style to use.format
numeric
{ "text": "'always' | 'auto'" }
'auto'When `auto`, values such as "yesterday" and "tomorrow" will be shown when possible. When `always`, values such as "1 day ago" and "in 1 day" will be shown.numeric
sync
{ "text": "boolean" }
falseKeep the displayed value up to date as time passes.sync

sl-resize-observer

Properties
nametypedefaultdescriptionattributereflects
disabled
{ "text": "boolean" }
falseDisables the observer.disabledtrue
Attributes
nametypedefaultdescriptionfieldName
disabled
{ "text": "boolean" }
falseDisables the observer.disabled
Slots
namedescription
One or more elements to watch for resizing.
Events
nametypedescriptionreactNameeventName
sl-resize
{ "text": "{ entries: ResizeObserverEntry[] }" }
Emitted when the element is resized.onSlResizeSlResizeEvent
Methods
name
handleDisabledChange

sl-select

Properties
nametypedefaultdescriptionattributereflectsreadonlystaticprivacy
dependencies
{ "text": "object" }
{ 'sl-icon': SlIcon, 'sl-popup': SlPopup, 'sl-tag': SlTag } - - - - true -
popup
{ "text": "SlPopup" }
- - - - - - -
combobox
{ "text": "HTMLSlotElement" }
- - - - - - -
displayInput
{ "text": "HTMLInputElement" }
- - - - - - -
valueInput
{ "text": "HTMLInputElement" }
- - - - - - -
listbox
{ "text": "HTMLSlotElement" }
- - - - - - -
displayLabel
{ "text": "string" }
'' - - - - - -
currentOption
{ "text": "SlOption" }
- - - - - - -
selectedOptions
{ "text": "SlOption[]" }
[] - - - - - -
name
{ "text": "string" }
''The name of the select, submitted as a name/value pair with form data.name - - - -
value
{ "text": "string | string[]" }
''The current value of the select, submitted as a name/value pair with form data. When `multiple` is enabled, the value attribute will be a space-delimited list of values based on the options selected, and the value property will be an array. **For this reason, values must not contain spaces.**value - - - -
defaultValue
{ "text": "string | string[]" }
''The default value of the form control. Primarily used for resetting the form control. - - - - -
size
{ "text": "'small' | 'medium' | 'large'" }
'medium'The select's size.sizetrue - - -
placeholder
{ "text": "string" }
''Placeholder text to show as a hint when the select is empty.placeholder - - - -
multiple
{ "text": "boolean" }
falseAllows more than one option to be selected.multipletrue - - -
maxOptionsVisible
{ "text": "number" }
3The maximum number of selected options to show when `multiple` is true. After the maximum, "+n" will be shown to indicate the number of additional items that are selected. Set to 0 to remove the limit.max-options-visible - - - -
disabled
{ "text": "boolean" }
falseDisables the select control.disabledtrue - - -
clearable
{ "text": "boolean" }
falseAdds a clear button when the select is not empty.clearable - - - -
open
{ "text": "boolean" }
falseIndicates whether or not the select is open. You can toggle this attribute to show and hide the menu, or you can use the `show()` and `hide()` methods and this attribute will reflect the select's open state.opentrue - - -
hoist
{ "text": "boolean" }
falseEnable this option to prevent the listbox from being clipped when the component is placed inside a container with `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.hoist - - - -
filled
{ "text": "boolean" }
falseDraws a filled select.filledtrue - - -
pill
{ "text": "boolean" }
falseDraws a pill-style select with rounded edges.pilltrue - - -
label
{ "text": "string" }
''The select's label. If you need to display HTML, use the `label` slot instead.label - - - -
placement
{ "text": "'top' | 'bottom'" }
'bottom'The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox inside of the viewport.placementtrue - - -
helpText
{ "text": "string" }
''The select's help text. If you need to display HTML, use the `help-text` slot instead.help-text - - - -
form
{ "text": "string" }
''By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.formtrue - - -
required
{ "text": "boolean" }
falseThe select's required attribute.requiredtrue - - -
getTag
{ "text": "(option: SlOption, index: number) => TemplateResult | string | HTMLElement" }
- A function that customizes the tags to be rendered when multiple=true. The first argument is the option, the second is the current tag's index. The function should return either a Lit TemplateResult or a string containing trusted HTML of the symbol to render at the specified value.getTag - - - -
validity - - Gets the validity state object - - true - -
validationMessage - - Gets the validation message - - true - -
tags - - - - - true - protected
Attributes
nametypedescriptionfieldNamedefault
name
{ "text": "string" }
The name of the select, submitted as a name/value pair with form data.name''
value
{ "text": "string | string[]" }
The current value of the select, submitted as a name/value pair with form data. When `multiple` is enabled, the value attribute will be a space-delimited list of values based on the options selected, and the value property will be an array. **For this reason, values must not contain spaces.**value''
size
{ "text": "'small' | 'medium' | 'large'" }
The select's size.size'medium'
placeholder
{ "text": "string" }
Placeholder text to show as a hint when the select is empty.placeholder''
multiple
{ "text": "boolean" }
Allows more than one option to be selected.multiplefalse
max-options-visible
{ "text": "number" }
The maximum number of selected options to show when `multiple` is true. After the maximum, "+n" will be shown to indicate the number of additional items that are selected. Set to 0 to remove the limit.maxOptionsVisible3
disabled
{ "text": "boolean" }
Disables the select control.disabledfalse
clearable
{ "text": "boolean" }
Adds a clear button when the select is not empty.clearablefalse
open
{ "text": "boolean" }
Indicates whether or not the select is open. You can toggle this attribute to show and hide the menu, or you can use the `show()` and `hide()` methods and this attribute will reflect the select's open state.openfalse
hoist
{ "text": "boolean" }
Enable this option to prevent the listbox from being clipped when the component is placed inside a container with `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.hoistfalse
filled
{ "text": "boolean" }
Draws a filled select.filledfalse
pill
{ "text": "boolean" }
Draws a pill-style select with rounded edges.pillfalse
label
{ "text": "string" }
The select's label. If you need to display HTML, use the `label` slot instead.label''
placement
{ "text": "'top' | 'bottom'" }
The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox inside of the viewport.placement'bottom'
help-text
{ "text": "string" }
The select's help text. If you need to display HTML, use the `help-text` slot instead.helpText''
form
{ "text": "string" }
By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.form''
required
{ "text": "boolean" }
The select's required attribute.requiredfalse
getTag
{ "text": "(option: SlOption, index: number) => TemplateResult | string | HTMLElement" }
A function that customizes the tags to be rendered when multiple=true. The first argument is the option, the second is the current tag's index. The function should return either a Lit TemplateResult or a string containing trusted HTML of the symbol to render at the specified value.getTag -
CSS Parts
namedescription
form-controlThe form control that wraps the label, input, and help text.
form-control-labelThe label's wrapper.
form-control-inputThe select's wrapper.
form-control-help-textThe help text's wrapper.
comboboxThe container the wraps the prefix, combobox, clear icon, and expand button.
prefixThe container that wraps the prefix slot.
display-inputThe element that displays the selected option's label, an `<input>` element.
listboxThe listbox container where options are slotted.
tagsThe container that houses option tags when `multiselect` is used.
tagThe individual tags that represent each multiselect option.
tag__baseThe tag's base part.
tag__contentThe tag's content part.
tag__remove-buttonThe tag's remove button.
tag__remove-button__baseThe tag's remove button base part.
clear-buttonThe clear button.
expand-iconThe container that wraps the expand icon.
Slots
namedescription
The listbox options. Must be `<sl-option>` elements. You can use `<sl-divider>` to group items visually.
labelThe input's label. Alternatively, you can use the `label` attribute.
prefixUsed to prepend a presentational icon or similar element to the combobox.
clear-iconAn icon to use in lieu of the default clear icon.
expand-iconThe icon to show when the control is expanded and collapsed. Rotates on open and close.
help-textText that describes how to use the input. Alternatively, you can use the `help-text` attribute.
Events
namedescriptionreactNameeventName
sl-changeEmitted when the control's value changes.onSlChangeSlChangeEvent
sl-clearEmitted when the control's value is cleared.onSlClearSlClearEvent
sl-inputEmitted when the control receives input.onSlInputSlInputEvent
sl-focusEmitted when the control gains focus.onSlFocusSlFocusEvent
sl-blurEmitted when the control loses focus.onSlBlurSlBlurEvent
sl-showEmitted when the select's menu opens.onSlShowSlShowEvent
sl-after-showEmitted after the select's menu opens and all animations are complete.onSlAfterShowSlAfterShowEvent
sl-hideEmitted when the select's menu closes.onSlHideSlHideEvent
sl-after-hideEmitted after the select's menu closes and all animations are complete.onSlAfterHideSlAfterHideEvent
sl-invalidEmitted when the form control has been checked for validity and its constraints aren't satisfied.onSlInvalidSlInvalidEvent
Methods
namedescriptionparametersreturn
handleDisabledChange - - -
handleValueChange - - -
handleOpenChange - - -
showShows the listbox. - -
hideHides the listbox. - -
checkValidityChecks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. - -
getFormGets the associated form, if one exists. -
{ "type": { "text": "HTMLFormElement | null" } }
reportValidityChecks for validity and shows the browser's validation message if the control is invalid. - -
setCustomValiditySets a custom validation message. Pass an empty string to restore validity.
parameters
nametype
message
{ "text": "string" }
-
focusSets focus on the control.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
-
blurRemoves focus from the control. - -

sl-skeleton

Properties
nametypedefaultdescriptionattribute
effect
{ "text": "'pulse' | 'sheen' | 'none'" }
'none'Determines which effect the skeleton will use.effect
Attributes
nametypedefaultdescriptionfieldName
effect
{ "text": "'pulse' | 'sheen' | 'none'" }
'none'Determines which effect the skeleton will use.effect
CSS Properties
namedescription
--border-radiusThe skeleton's border radius.
--colorThe color of the skeleton.
--sheen-colorThe sheen color when the skeleton is in its loading state.
CSS Parts
namedescription
baseThe component's base wrapper.
indicatorThe skeleton's indicator which is responsible for its color and animation.

sl-spinner

CSS Properties
namedescription
--track-widthThe width of the track.
--track-colorThe color of the track.
--indicator-colorThe color of the spinner's indicator.
--speedThe time it takes for the spinner to complete one animation cycle.
CSS Parts
namedescription
baseThe component's base wrapper.

sl-split-panel

Properties
nametypedescriptionattributedefaultreflects
divider
{ "text": "HTMLElement" }
- - - -
position
{ "text": "number" }
The current position of the divider from the primary panel's edge as a percentage 0-100. Defaults to 50% of the container's initial size.position50true
positionInPixels
{ "text": "number" }
The current position of the divider from the primary panel's edge in pixels.position-in-pixels - -
vertical
{ "text": "boolean" }
Draws the split panel in a vertical orientation with the start and end panels stacked.verticalfalsetrue
disabled
{ "text": "boolean" }
Disables resizing. Note that the position may still change as a result of resizing the host element.disabledfalsetrue
primary
{ "text": "'start' | 'end' | undefined" }
If no primary panel is designated, both panels will resize proportionally when the host element is resized. If a primary panel is designated, it will maintain its size and the other panel will grow or shrink as needed when the host element is resized.primary - -
snap
{ "text": "string | undefined" }
One or more space-separated values at which the divider should snap. Values can be in pixels or percentages, e.g. `"100px 50%"`.snap - -
snapThreshold
{ "text": "number" }
How close the divider must be to a snap point until snapping occurs.snap-threshold12 -
Attributes
nametypedescriptionfieldNamedefault
position
{ "text": "number" }
The current position of the divider from the primary panel's edge as a percentage 0-100. Defaults to 50% of the container's initial size.position50
position-in-pixels
{ "text": "number" }
The current position of the divider from the primary panel's edge in pixels.positionInPixels -
vertical
{ "text": "boolean" }
Draws the split panel in a vertical orientation with the start and end panels stacked.verticalfalse
disabled
{ "text": "boolean" }
Disables resizing. Note that the position may still change as a result of resizing the host element.disabledfalse
primary
{ "text": "'start' | 'end' | undefined" }
If no primary panel is designated, both panels will resize proportionally when the host element is resized. If a primary panel is designated, it will maintain its size and the other panel will grow or shrink as needed when the host element is resized.primary -
snap
{ "text": "string | undefined" }
One or more space-separated values at which the divider should snap. Values can be in pixels or percentages, e.g. `"100px 50%"`.snap -
snap-threshold
{ "text": "number" }
How close the divider must be to a snap point until snapping occurs.snapThreshold12
CSS Properties
namedescriptiondefault
--divider-widthThe width of the visible divider.4px
--divider-hit-areaThe invisible region around the divider where dragging can occur. This is usually wider than the divider to facilitate easier dragging.12px
--minThe minimum allowed size of the primary panel.0
--maxThe maximum allowed size of the primary panel.100%
CSS Parts
namedescription
startThe start panel.
endThe end panel.
panelTargets both the start and end panels.
dividerThe divider that separates the start and end panels.
Slots
namedescription
startContent to place in the start panel.
endContent to place in the end panel.
dividerThe divider. Useful for slotting in a custom icon that renders as a handle.
Events
namedescriptionreactNameeventName
sl-repositionEmitted when the divider's position changes.onSlRepositionSlRepositionEvent
Methods
name
handlePositionChange
handlePositionInPixelsChange
handleVerticalChange

sl-tab

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-icon-button': SlIconButton } - - - true
tab
{ "text": "HTMLElement" }
- - - - -
panel
{ "text": "string" }
''The name of the tab panel this tab is associated with. The panel must be located in the same tab group.paneltrue -
active
{ "text": "boolean" }
falseDraws the tab in an active state.activetrue -
closable
{ "text": "boolean" }
falseMakes the tab closable and shows a close button.closable - -
disabled
{ "text": "boolean" }
falseDisables the tab and prevents selection.disabledtrue -
Attributes
nametypedefaultdescriptionfieldName
panel
{ "text": "string" }
''The name of the tab panel this tab is associated with. The panel must be located in the same tab group.panel
active
{ "text": "boolean" }
falseDraws the tab in an active state.active
closable
{ "text": "boolean" }
falseMakes the tab closable and shows a close button.closable
disabled
{ "text": "boolean" }
falseDisables the tab and prevents selection.disabled
CSS Parts
namedescription
baseThe component's base wrapper.
close-buttonThe close button, an `<sl-icon-button>`.
close-button__baseThe close button's exported `base` part.
Slots
namedescription
The tab's label.
Events
namedescriptionreactNameeventName
sl-closeEmitted when the tab is closable and the close button is activated.onSlCloseSlCloseEvent
Methods
namedescriptionparameters
handleActiveChange - -
handleDisabledChange - -
focusSets focus to the tab.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
blurRemoves focus from the tab. -

sl-tab-group

Properties
nametypedefaultdescriptionattributestatic
dependencies
{ "text": "object" }
{ 'sl-icon-button': SlIconButton } - - true
tabGroup
{ "text": "HTMLElement" }
- - - -
body
{ "text": "HTMLSlotElement" }
- - - -
nav
{ "text": "HTMLElement" }
- - - -
indicator
{ "text": "HTMLElement" }
- - - -
placement
{ "text": "'top' | 'bottom' | 'start' | 'end'" }
'top'The placement of the tabs.placement -
activation
{ "text": "'auto' | 'manual'" }
'auto'When set to auto, navigating tabs with the arrow keys will instantly show the corresponding tab panel. When set to manual, the tab will receive focus but will not show until the user presses spacebar or enter.activation -
noScrollControls
{ "text": "boolean" }
falseDisables the scroll arrows that appear when tabs overflow.no-scroll-controls -
Attributes
nametypedefaultdescriptionfieldName
placement
{ "text": "'top' | 'bottom' | 'start' | 'end'" }
'top'The placement of the tabs.placement
activation
{ "text": "'auto' | 'manual'" }
'auto'When set to auto, navigating tabs with the arrow keys will instantly show the corresponding tab panel. When set to manual, the tab will receive focus but will not show until the user presses spacebar or enter.activation
no-scroll-controls
{ "text": "boolean" }
falseDisables the scroll arrows that appear when tabs overflow.noScrollControls
CSS Properties
namedescription
--indicator-colorThe color of the active tab indicator.
--track-colorThe color of the indicator's track (the line that separates tabs from panels).
--track-widthThe width of the indicator's track (the line that separates tabs from panels).
CSS Parts
namedescription
baseThe component's base wrapper.
navThe tab group's navigation container where tabs are slotted in.
tabsThe container that wraps the tabs.
active-tab-indicatorThe line that highlights the currently selected tab.
bodyThe tab group's body where tab panels are slotted in.
scroll-buttonThe previous/next scroll buttons that show when tabs are scrollable, an `<sl-icon-button>`.
scroll-button--startThe starting scroll button.
scroll-button--endThe ending scroll button.
scroll-button__baseThe scroll button's exported `base` part.
Slots
namedescription
Used for grouping tab panels in the tab group. Must be `<sl-tab-panel>` elements.
navUsed for grouping tabs in the tab group. Must be `<sl-tab>` elements.
Events
nametypedescriptionreactNameeventName
sl-tab-show
{ "text": "{ name: String }" }
Emitted when a tab is shown.onSlTabShowSlTabShowEvent
sl-tab-hide
{ "text": "{ name: String }" }
Emitted when a tab is hidden.onSlTabHideSlTabHideEvent
Methods
nameparametersdescription
updateScrollControls - -
syncIndicator - -
show
parameters
nametype
panel
{ "text": "string" }
Shows the specified tab panel.

sl-tab-panel

Properties
nametypedefaultdescriptionattributereflects
name
{ "text": "string" }
''The tab panel's name.nametrue
active
{ "text": "boolean" }
falseWhen true, the tab panel will be shown.activetrue
Attributes
nametypedefaultdescriptionfieldName
name
{ "text": "string" }
''The tab panel's name.name
active
{ "text": "boolean" }
falseWhen true, the tab panel will be shown.active
CSS Properties
namedescription
--paddingThe tab panel's padding.
CSS Parts
namedescription
baseThe component's base wrapper.
Slots
namedescription
The tab panel's content.
Methods
name
handleActiveChange

sl-switch

Properties
nametypedescriptiondefaultattributereflectsreadonly
input
{ "text": "HTMLInputElement" }
- - - - -
title
{ "text": "string" }
- ''title - -
name
{ "text": "string" }
The name of the switch, submitted as a name/value pair with form data.''name - -
value
{ "text": "string" }
The current value of the switch, submitted as a name/value pair with form data. - value - -
size
{ "text": "'small' | 'medium' | 'large'" }
The switch's size.'medium'sizetrue -
disabled
{ "text": "boolean" }
Disables the switch.falsedisabledtrue -
checked
{ "text": "boolean" }
Draws the switch in a checked state.falsecheckedtrue -
defaultChecked
{ "text": "boolean" }
The default value of the form control. Primarily used for resetting the form control.false - - -
form
{ "text": "string" }
By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.''formtrue -
required
{ "text": "boolean" }
Makes the switch a required field.falserequiredtrue -
helpText
{ "text": "string" }
The switch's help text. If you need to display HTML, use the `help-text` slot instead.''help-text - -
validity - Gets the validity state object - - - true
validationMessage - Gets the validation message - - - true
Attributes
nametypefieldNamedefaultdescription
title
{ "text": "string" }
title'' -
name
{ "text": "string" }
name''The name of the switch, submitted as a name/value pair with form data.
value
{ "text": "string" }
value - The current value of the switch, submitted as a name/value pair with form data.
size
{ "text": "'small' | 'medium' | 'large'" }
size'medium'The switch's size.
disabled
{ "text": "boolean" }
disabledfalseDisables the switch.
checked
{ "text": "boolean" }
checkedfalseDraws the switch in a checked state.
form
{ "text": "string" }
form''By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.
required
{ "text": "boolean" }
requiredfalseMakes the switch a required field.
help-text
{ "text": "string" }
helpText''The switch's help text. If you need to display HTML, use the `help-text` slot instead.
CSS Properties
namedescription
--widthThe width of the switch.
--heightThe height of the switch.
--thumb-sizeThe size of the thumb.
CSS Parts
namedescription
baseThe component's base wrapper.
controlThe control that houses the switch's thumb.
thumbThe switch's thumb.
labelThe switch's label.
form-control-help-textThe help text's wrapper.
Slots
namedescription
The switch's label.
help-textText that describes how to use the switch. Alternatively, you can use the `help-text` attribute.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the control loses focus.onSlBlurSlBlurEvent
sl-changeEmitted when the control's checked state changes.onSlChangeSlChangeEvent
sl-inputEmitted when the control receives input.onSlInputSlInputEvent
sl-focusEmitted when the control gains focus.onSlFocusSlFocusEvent
sl-invalidEmitted when the form control has been checked for validity and its constraints aren't satisfied.onSlInvalidSlInvalidEvent
Methods
namedescriptionparametersreturn
handleCheckedChange - - -
handleDisabledChange - - -
clickSimulates a click on the switch. - -
focusSets focus on the switch.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
-
blurRemoves focus from the switch. - -
checkValidityChecks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. - -
getFormGets the associated form, if one exists. -
{ "type": { "text": "HTMLFormElement | null" } }
reportValidityChecks for validity and shows the browser's validation message if the control is invalid. - -
setCustomValiditySets a custom validation message. Pass an empty string to restore validity.
parameters
nametype
message
{ "text": "string" }
-

sl-tag

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-icon-button': SlIconButton } - - - true
variant
{ "text": "'primary' | 'success' | 'neutral' | 'warning' | 'danger' | 'text'" }
'neutral'The tag's theme variant.varianttrue -
size
{ "text": "'small' | 'medium' | 'large'" }
'medium'The tag's size.sizetrue -
pill
{ "text": "boolean" }
falseDraws a pill-style tag with rounded edges.pilltrue -
removable
{ "text": "boolean" }
falseMakes the tag removable and shows a remove button.removable - -
Attributes
nametypedefaultdescriptionfieldName
variant
{ "text": "'primary' | 'success' | 'neutral' | 'warning' | 'danger' | 'text'" }
'neutral'The tag's theme variant.variant
size
{ "text": "'small' | 'medium' | 'large'" }
'medium'The tag's size.size
pill
{ "text": "boolean" }
falseDraws a pill-style tag with rounded edges.pill
removable
{ "text": "boolean" }
falseMakes the tag removable and shows a remove button.removable
CSS Parts
namedescription
baseThe component's base wrapper.
contentThe tag's content.
remove-buttonThe tag's remove button, an `<sl-icon-button>`.
remove-button__baseThe remove button's exported `base` part.
Slots
namedescription
The tag's content.
Events
namedescriptionreactNameeventName
sl-removeEmitted when the remove button is activated.onSlRemoveSlRemoveEvent

sl-textarea

Properties
nametypedescriptionattributedefaultreflectsreadonly
input
{ "text": "HTMLTextAreaElement" }
- - - - -
title
{ "text": "string" }
- title'' - -
name
{ "text": "string" }
The name of the textarea, submitted as a name/value pair with form data.name'' - -
value
{ "text": "string" }
The current value of the textarea, submitted as a name/value pair with form data.value'' - -
size
{ "text": "'small' | 'medium' | 'large'" }
The textarea's size.size'medium'true -
filled
{ "text": "boolean" }
Draws a filled textarea.filledfalsetrue -
label
{ "text": "string" }
The textarea's label. If you need to display HTML, use the `label` slot instead.label'' - -
helpText
{ "text": "string" }
The textarea's help text. If you need to display HTML, use the `help-text` slot instead.help-text'' - -
placeholder
{ "text": "string" }
Placeholder text to show as a hint when the input is empty.placeholder'' - -
rows
{ "text": "number" }
The number of rows to display by default.rows4 - -
resize
{ "text": "'none' | 'vertical' | 'auto'" }
Controls how the textarea can be resized.resize'vertical' - -
disabled
{ "text": "boolean" }
Disables the textarea.disabledfalsetrue -
readonly
{ "text": "boolean" }
Makes the textarea readonly.readonlyfalsetrue -
form
{ "text": "string" }
By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.form''true -
required
{ "text": "boolean" }
Makes the textarea a required field.requiredfalsetrue -
minlength
{ "text": "number" }
The minimum length of input that will be considered valid.minlength - - -
maxlength
{ "text": "number" }
The maximum length of input that will be considered valid.maxlength - - -
autocapitalize
{ "text": "'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'" }
Controls whether and how text input is automatically capitalized as it is entered by the user.autocapitalize - - -
autocorrect
{ "text": "string" }
Indicates whether the browser's autocorrect feature is on or off.autocorrect - - -
autocomplete
{ "text": "string" }
Specifies what permission the browser has to provide assistance in filling out form field values. Refer to [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.autocomplete - - -
autofocus
{ "text": "boolean" }
Indicates that the input should receive focus on page load.autofocus - - -
enterkeyhint
{ "text": "'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'" }
Used to customize the label or icon of the Enter key on virtual keyboards.enterkeyhint - - -
spellcheck
{ "text": "boolean" }
Enables spell checking on the textarea.spellchecktrue - -
inputmode
{ "text": "'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'" }
Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual keyboard on supportive devices.inputmode - - -
defaultValue
{ "text": "string" }
The default value of the form control. Primarily used for resetting the form control. - '' - -
validity - Gets the validity state object - - - true
validationMessage - Gets the validation message - - - true
Attributes
nametypefieldNamedescriptiondefault
title
{ "text": "string" }
title - ''
name
{ "text": "string" }
nameThe name of the textarea, submitted as a name/value pair with form data.''
value
{ "text": "string" }
valueThe current value of the textarea, submitted as a name/value pair with form data.''
size
{ "text": "'small' | 'medium' | 'large'" }
sizeThe textarea's size.'medium'
filled
{ "text": "boolean" }
filledDraws a filled textarea.false
label
{ "text": "string" }
labelThe textarea's label. If you need to display HTML, use the `label` slot instead.''
help-text
{ "text": "string" }
helpTextThe textarea's help text. If you need to display HTML, use the `help-text` slot instead.''
placeholder
{ "text": "string" }
placeholderPlaceholder text to show as a hint when the input is empty.''
rows
{ "text": "number" }
rowsThe number of rows to display by default.4
resize
{ "text": "'none' | 'vertical' | 'auto'" }
resizeControls how the textarea can be resized.'vertical'
disabled
{ "text": "boolean" }
disabledDisables the textarea.false
readonly
{ "text": "boolean" }
readonlyMakes the textarea readonly.false
form
{ "text": "string" }
formBy default, form controls are associated with the nearest containing `<form>` element. This attribute allows you to place the form control outside of a form and associate it with the form that has this `id`. The form must be in the same document or shadow root for this to work.''
required
{ "text": "boolean" }
requiredMakes the textarea a required field.false
minlength
{ "text": "number" }
minlengthThe minimum length of input that will be considered valid. -
maxlength
{ "text": "number" }
maxlengthThe maximum length of input that will be considered valid. -
autocapitalize
{ "text": "'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'" }
autocapitalizeControls whether and how text input is automatically capitalized as it is entered by the user. -
autocorrect
{ "text": "string" }
autocorrectIndicates whether the browser's autocorrect feature is on or off. -
autocomplete
{ "text": "string" }
autocompleteSpecifies what permission the browser has to provide assistance in filling out form field values. Refer to [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values. -
autofocus
{ "text": "boolean" }
autofocusIndicates that the input should receive focus on page load. -
enterkeyhint
{ "text": "'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'" }
enterkeyhintUsed to customize the label or icon of the Enter key on virtual keyboards. -
spellcheck
{ "text": "boolean" }
spellcheckEnables spell checking on the textarea.true
inputmode
{ "text": "'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'" }
inputmodeTells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual keyboard on supportive devices. -
CSS Parts
namedescription
form-controlThe form control that wraps the label, input, and help text.
form-control-labelThe label's wrapper.
form-control-inputThe input's wrapper.
form-control-help-textThe help text's wrapper.
baseThe component's base wrapper.
textareaThe internal `<textarea>` control.
Slots
namedescription
labelThe textarea's label. Alternatively, you can use the `label` attribute.
help-textText that describes how to use the input. Alternatively, you can use the `help-text` attribute.
Events
namedescriptionreactNameeventName
sl-blurEmitted when the control loses focus.onSlBlurSlBlurEvent
sl-changeEmitted when an alteration to the control's value is committed by the user.onSlChangeSlChangeEvent
sl-focusEmitted when the control gains focus.onSlFocusSlFocusEvent
sl-inputEmitted when the control receives input.onSlInputSlInputEvent
sl-invalidEmitted when the form control has been checked for validity and its constraints aren't satisfied.onSlInvalidSlInvalidEvent
Methods
namedescriptionparametersreturn
handleDisabledChange - - -
handleRowsChange - - -
handleValueChange - - -
focusSets focus on the textarea.
parameters
nameoptionaltype
optionstrue
{ "text": "FocusOptions" }
-
blurRemoves focus from the textarea. - -
selectSelects all the text in the textarea. - -
scrollPositionGets or sets the textarea's scroll position.
parameters
nameoptionaltype
positiontrue
{ "text": "{ top?: number; left?: number }" }
{ "type": { "text": "{ top: number; left: number } | undefined" } }
setSelectionRangeSets the start and end positions of the text selection (0-based).
parameters
nametypedefault
selectionStart
{ "text": "number" }
-
selectionEnd
{ "text": "number" }
-
selectionDirection
{ "text": "'forward' | 'backward' | 'none'" }
'none'
-
setRangeTextReplaces a range of text with a new string.
parameters
nametypeoptionaldefault
replacement
{ "text": "string" }
- -
start
{ "text": "number" }
true -
end
{ "text": "number" }
true -
selectMode
{ "text": "'select' | 'start' | 'end' | 'preserve'" }
- 'preserve'
-
checkValidityChecks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. - -
getFormGets the associated form, if one exists. -
{ "type": { "text": "HTMLFormElement | null" } }
reportValidityChecks for validity and shows the browser's validation message if the control is invalid. - -
setCustomValiditySets a custom validation message. Pass an empty string to restore validity.
parameters
nametype
message
{ "text": "string" }
-

sl-tooltip

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-popup': SlPopup } - - - true
defaultSlot
{ "text": "HTMLSlotElement" }
- - - - -
body
{ "text": "HTMLElement" }
- - - - -
popup
{ "text": "SlPopup" }
- - - - -
content
{ "text": "string" }
''The tooltip's content. If you need to display HTML, use the `content` slot instead.content - -
placement
{ "text": "| 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'" }
'top'The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip inside of the viewport.placement - -
disabled
{ "text": "boolean" }
falseDisables the tooltip so it won't show when triggered.disabledtrue -
distance
{ "text": "number" }
8The distance in pixels from which to offset the tooltip away from its target.distance - -
open
{ "text": "boolean" }
falseIndicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods.opentrue -
skidding
{ "text": "number" }
0The distance in pixels from which to offset the tooltip along its target.skidding - -
trigger
{ "text": "string" }
'hover focus'Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple options can be passed by separating them with a space. When manual is used, the tooltip must be activated programmatically.trigger - -
hoist
{ "text": "boolean" }
falseEnable this option to prevent the tooltip from being clipped when the component is placed inside a container with `overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.hoist - -
Attributes
nametypedefaultdescriptionfieldName
content
{ "text": "string" }
''The tooltip's content. If you need to display HTML, use the `content` slot instead.content
placement
{ "text": "| 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'" }
'top'The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip inside of the viewport.placement
disabled
{ "text": "boolean" }
falseDisables the tooltip so it won't show when triggered.disabled
distance
{ "text": "number" }
8The distance in pixels from which to offset the tooltip away from its target.distance
open
{ "text": "boolean" }
falseIndicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods.open
skidding
{ "text": "number" }
0The distance in pixels from which to offset the tooltip along its target.skidding
trigger
{ "text": "string" }
'hover focus'Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple options can be passed by separating them with a space. When manual is used, the tooltip must be activated programmatically.trigger
hoist
{ "text": "boolean" }
falseEnable this option to prevent the tooltip from being clipped when the component is placed inside a container with `overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.hoist
CSS Properties
namedescription
--max-widthThe maximum width of the tooltip before its content will wrap.
--hide-delayThe amount of time to wait before hiding the tooltip when hovering.
--show-delayThe amount of time to wait before showing the tooltip when hovering.
CSS Parts
namedescription
baseThe component's base wrapper, an `<sl-popup>` element.
base__popupThe popup's exported `popup` part. Use this to target the tooltip's popup container.
base__arrowThe popup's exported `arrow` part. Use this to target the tooltip's arrow.
bodyThe tooltip's body where its content is rendered.
Slots
namedescription
The tooltip's target element. Avoid slotting in more than one element, as subsequent ones will be ignored.
contentThe content to render in the tooltip. Alternatively, you can use the `content` attribute.
Events
namedescriptionreactNameeventName
sl-showEmitted when the tooltip begins to show.onSlShowSlShowEvent
sl-after-showEmitted after the tooltip has shown and all animations are complete.onSlAfterShowSlAfterShowEvent
sl-hideEmitted when the tooltip begins to hide.onSlHideSlHideEvent
sl-after-hideEmitted after the tooltip has hidden and all animations are complete.onSlAfterHideSlAfterHideEvent
Methods
namedescription
handleOpenChange -
handleOptionsChange -
handleDisabledChange -
showShows the tooltip.
hideHides the tooltip

sl-tree

Properties
nametypedefaultdescriptionattribute
defaultSlot
{ "text": "HTMLSlotElement" }
- - -
expandedIconSlot
{ "text": "HTMLSlotElement" }
- - -
collapsedIconSlot
{ "text": "HTMLSlotElement" }
- - -
selection
{ "text": "'single' | 'multiple' | 'leaf'" }
'single'The selection behavior of the tree. Single selection allows only one node to be selected at a time. Multiple displays checkboxes and allows more than one node to be selected. Leaf allows only leaf nodes to be selected.selection
Attributes
nametypedefaultdescriptionfieldName
selection
{ "text": "'single' | 'multiple' | 'leaf'" }
'single'The selection behavior of the tree. Single selection allows only one node to be selected at a time. Multiple displays checkboxes and allows more than one node to be selected. Leaf allows only leaf nodes to be selected.selection
CSS Properties
namedescriptiondefault
--indent-sizeThe size of the indentation for nested items.var(--sl-spacing-medium)
--indent-guide-colorThe color of the indentation line.var(--sl-color-neutral-200)
--indent-guide-offsetThe amount of vertical spacing to leave between the top and bottom of the indentation line's starting position.0
--indent-guide-styleThe style of the indentation line, e.g. solid, dotted, dashed.solid
--indent-guide-widthThe width of the indentation line.0
CSS Parts
namedescription
baseThe component's base wrapper.
Slots
namedescription
The default slot.
expand-iconThe icon to show when the tree item is expanded. Works best with `<sl-icon>`.
collapse-iconThe icon to show when the tree item is collapsed. Works best with `<sl-icon>`.
Events
nametypedescriptionreactNameeventName
sl-selection-change
{ "text": "{ selection: SlTreeItem[] }" }
Emitted when a tree item is selected or deselected.onSlSelectionChangeSlSelectionChangeEvent
Methods
nameparameters
handleMouseDown
parameters
nametype
event
{ "text": "MouseEvent" }
handleSelectionChange -

sl-tree-item

Properties
nametypedefaultdescriptionattributereflectsstatic
dependencies
{ "text": "object" }
{ 'sl-checkbox': SlCheckbox, 'sl-icon': SlIcon, 'sl-spinner': SlSpinner } - - - true
indeterminate
{ "text": "boolean" }
false - - - -
isLeaf
{ "text": "boolean" }
false - - - -
loading
{ "text": "boolean" }
false - - - -
selectable
{ "text": "boolean" }
false - - - -
expanded
{ "text": "boolean" }
falseExpands the tree item.expandedtrue -
selected
{ "text": "boolean" }
falseDraws the tree item in a selected state.selectedtrue -
disabled
{ "text": "boolean" }
falseDisables the tree item.disabledtrue -
lazy
{ "text": "boolean" }
falseEnables lazy loading behavior.lazytrue -
defaultSlot
{ "text": "HTMLSlotElement" }
- - - - -
childrenSlot
{ "text": "HTMLSlotElement" }
- - - - -
itemElement
{ "text": "HTMLDivElement" }
- - - - -
childrenContainer
{ "text": "HTMLDivElement" }
- - - - -
expandButtonSlot
{ "text": "HTMLSlotElement" }
- - - - -
Attributes
nametypedefaultdescriptionfieldName
expanded
{ "text": "boolean" }
falseExpands the tree item.expanded
selected
{ "text": "boolean" }
falseDraws the tree item in a selected state.selected
disabled
{ "text": "boolean" }
falseDisables the tree item.disabled
lazy
{ "text": "boolean" }
falseEnables lazy loading behavior.lazy
CSS Parts
namedescription
baseThe component's base wrapper.
itemThe tree item's container. This element wraps everything except slotted tree item children.
item--disabledApplied when the tree item is disabled.
item--expandedApplied when the tree item is expanded.
item--indeterminateApplied when the selection is indeterminate.
item--selectedApplied when the tree item is selected.
indentationThe tree item's indentation container.
expand-buttonThe container that wraps the tree item's expand button and spinner.
spinnerThe spinner that shows when a lazy tree item is in the loading state.
spinner__baseThe spinner's base part.
labelThe tree item's label.
childrenThe container that wraps the tree item's nested children.
checkboxThe checkbox that shows when using multiselect.
checkbox__baseThe checkbox's exported `base` part.
checkbox__controlThe checkbox's exported `control` part.
checkbox__control--checkedThe checkbox's exported `control--checked` part.
checkbox__control--indeterminateThe checkbox's exported `control--indeterminate` part.
checkbox__checked-iconThe checkbox's exported `checked-icon` part.
checkbox__indeterminate-iconThe checkbox's exported `indeterminate-icon` part.
checkbox__labelThe checkbox's exported `label` part.
Slots
namedescription
The default slot.
expand-iconThe icon to show when the tree item is expanded.
collapse-iconThe icon to show when the tree item is collapsed.
Events
namedescriptionreactNameeventName
sl-expandEmitted when the tree item expands.onSlExpandSlExpandEvent
sl-after-expandEmitted after the tree item expands and all animations are complete.onSlAfterExpandSlAfterExpandEvent
sl-collapseEmitted when the tree item collapses.onSlCollapseSlCollapseEvent
sl-after-collapseEmitted after the tree item collapses and all animations are complete.onSlAfterCollapseSlAfterCollapseEvent
sl-lazy-changeEmitted when the tree item's lazy state changes.onSlLazyChangeSlLazyChangeEvent
sl-lazy-loadEmitted when a lazy item is selected. Use this event to asynchronously load data and append items to the tree before expanding. After appending new items, remove the `lazy` attribute to remove the loading state and update the tree.onSlLazyLoadSlLazyLoadEvent
Methods
nameparametersstaticreturndescription
isTreeItem
parameters
nametype
node
{ "text": "Node" }
true - -
handleLoadingChange - - - -
handleDisabledChange - - - -
handleSelectedChange - - - -
handleExpandedChange - - - -
handleExpandAnimation - - - -
handleLazyChange - - - -
getChildrenItems
parameters
namedefaulttype
{ includeDisabled = true }{}
{ "text": "{ includeDisabled?: boolean }" }
-
{ "type": { "text": "SlTreeItem[]" } }
Gets all the nested tree items in this node.

sl-visually-hidden

Slots
namedescription
The content to be visually hidden.