UNPKG

@shoelace-style/shoelace

Version:

A forward-thinking library of web components.

797 lines 155 kB
{ "$schema": "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json", "version": 1.1, "tags": [ { "name": "sl-alert", "description": "Alerts are used to display important messages inline or as toast notifications.\n---\n\n\n### **Events:**\n - **sl-show** - Emitted when the alert opens.\n- **sl-after-show** - Emitted after the alert opens and all animations are complete.\n- **sl-hide** - Emitted when the alert closes.\n- **sl-after-hide** - Emitted after the alert closes and all animations are complete.\n\n### **Methods:**\n - **show()** - Shows the alert.\n- **hide()** - Hides the alert\n- **toast()** - Displays the alert as a toast notification. This will move the alert out of its position in the DOM and, when\ndismissed, it will be removed from the DOM completely. By storing a reference to the alert, you can reuse it by\ncalling this method again. The returned promise will resolve after the alert is hidden.\n\n### **Slots:**\n - _default_ - The alert's main content.\n- **icon** - An icon to show in the alert. Works best with `<sl-icon>`.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **icon** - The container that wraps the optional icon.\n- **message** - The container that wraps the alert's main content.\n- **close-button** - The close button, an `<sl-icon-button>`.\n- **close-button__base** - The close button's exported `base` part.", "attributes": [ { "name": "open", "description": "Indicates whether or not the alert is open. You can toggle this attribute to show and hide the alert, or you can\nuse the `show()` and `hide()` methods and this attribute will reflect the alert's open state.", "values": [] }, { "name": "closable", "description": "Enables a close button that allows the user to dismiss the alert.", "values": [] }, { "name": "variant", "description": "The alert's theme variant.", "values": [ { "name": "primary" }, { "name": "success" }, { "name": "neutral" }, { "name": "warning" }, { "name": "danger" } ] }, { "name": "duration", "description": "The length of time, in milliseconds, the alert will show before closing itself. If the user interacts with\nthe alert before it closes (e.g. moves the mouse over it), the timer will restart. Defaults to `Infinity`, meaning\nthe alert will not close on its own.", "values": [] }, { "name": "countdown", "description": "Enables a countdown that indicates the remaining time the alert will be displayed.\nTypically used to indicate the remaining time before a whole app refresh.", "values": [{ "name": "rtl" }, { "name": "ltr" }] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/alert" } ] }, { "name": "sl-animation", "description": "Animate elements declaratively with nearly 100 baked-in presets, or roll your own with custom keyframes. Powered by the [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API).\n---\n\n\n### **Events:**\n - **sl-cancel** - Emitted when the animation is canceled.\n- **sl-finish** - Emitted when the animation finishes.\n- **sl-start** - Emitted when the animation starts or restarts.\n\n### **Methods:**\n - **cancel()** - Clears all keyframe effects caused by this animation and aborts its playback.\n- **finish()** - Sets the playback time to the end of the animation corresponding to the current playback direction.\n\n### **Slots:**\n - _default_ - 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.", "attributes": [ { "name": "name", "description": "The name of the built-in animation to use. For custom animations, use the `keyframes` prop.", "values": [] }, { "name": "play", "description": "Plays the animation. When omitted, the animation will be paused. This attribute will be automatically removed when\nthe animation finishes or gets canceled.", "values": [] }, { "name": "delay", "description": "The number of milliseconds to delay the start of the animation.", "values": [] }, { "name": "direction", "description": "Determines the direction of playback as well as the behavior when reaching the end of an iteration.\n[Learn more](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction)", "values": [{ "name": "PlaybackDirection" }] }, { "name": "duration", "description": "The number of milliseconds each iteration of the animation takes to complete.", "values": [] }, { "name": "easing", "description": "The easing function to use for the animation. This can be a Shoelace easing function or a custom easing function\nsuch as `cubic-bezier(0, 1, .76, 1.14)`.", "values": [] }, { "name": "end-delay", "description": "The number of milliseconds to delay after the active period of an animation sequence.", "values": [] }, { "name": "fill", "description": "Sets how the animation applies styles to its target before and after its execution.", "values": [{ "name": "FillMode" }] }, { "name": "iterations", "description": "The number of iterations to run before the animation completes. Defaults to `Infinity`, which loops.", "values": [] }, { "name": "iteration-start", "description": "The offset at which to start the animation, usually between 0 (start) and 1 (end).", "values": [] }, { "name": "playback-rate", "description": "Sets the animation's playback rate. The default is `1`, which plays the animation at a normal speed. Setting this\nto `2`, for example, will double the animation's speed. A negative value can be used to reverse the animation. This\nvalue can be changed without causing the animation to restart.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/animation" } ] }, { "name": "sl-animated-image", "description": "A component for displaying animated GIFs and WEBPs that play and pause on interaction.\n---\n\n\n### **Events:**\n - **sl-load** - Emitted when the image loads successfully.\n- **sl-error** - Emitted when the image fails to load.\n\n### **Slots:**\n - **play-icon** - Optional play icon to use instead of the default. Works best with `<sl-icon>`.\n- **pause-icon** - Optional pause icon to use instead of the default. Works best with `<sl-icon>`.\n\n### **CSS Properties:**\n - **--control-box-size** - The size of the icon box. _(default: undefined)_\n- **--icon-size** - The size of the play/pause icons. _(default: undefined)_\n\n### **CSS Parts:**\n - **control-box** - The container that surrounds the pause/play icons and provides their background.", "attributes": [ { "name": "src", "description": "The path to the image to load.", "values": [] }, { "name": "alt", "description": "A description of the image used by assistive devices.", "values": [] }, { "name": "play", "description": "Plays the animation. When this attribute is remove, the animation will pause.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/animated-image" } ] }, { "name": "sl-avatar", "description": "Avatars are used to represent a person or object.\n---\n\n\n### **Events:**\n - **sl-error** - The image could not be loaded. This may because of an invalid URL, a temporary network condition, or some unknown cause.\n\n### **Slots:**\n - **icon** - The default icon to use when no image or initials are present. Works best with `<sl-icon>`.\n\n### **CSS Properties:**\n - **--size** - The size of the avatar. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **icon** - The container that wraps the avatar's icon.\n- **initials** - The container that wraps the avatar's initials.\n- **image** - The avatar image. Only shown when the `image` attribute is set.", "attributes": [ { "name": "image", "description": "The image source to use for the avatar.", "values": [] }, { "name": "label", "description": "A label to use to describe the avatar to assistive devices.", "values": [] }, { "name": "initials", "description": "Initials to use as a fallback when no image is available (1-2 characters max recommended).", "values": [] }, { "name": "loading", "description": "Indicates how the browser should load the image.", "values": [{ "name": "eager" }, { "name": "lazy" }] }, { "name": "shape", "description": "The shape of the avatar.", "values": [ { "name": "circle" }, { "name": "square" }, { "name": "rounded" } ] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/avatar" } ] }, { "name": "sl-breadcrumb", "description": "Breadcrumbs provide a group of links so users can easily navigate a website's hierarchy.\n---\n\n\n### **Slots:**\n - _default_ - One or more breadcrumb items to display.\n- **separator** - The separator to use between breadcrumb items. Works best with `<sl-icon>`.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.", "attributes": [ { "name": "label", "description": "The label to use for the breadcrumb control. This will not be shown on the screen, but it will be announced by\nscreen readers and other assistive devices to provide more context for users.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/breadcrumb" } ] }, { "name": "sl-badge", "description": "Badges are used to draw attention and display statuses or counts.\n---\n\n\n### **Slots:**\n - _default_ - The badge's content.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.", "attributes": [ { "name": "variant", "description": "The badge's theme variant.", "values": [ { "name": "primary" }, { "name": "success" }, { "name": "neutral" }, { "name": "warning" }, { "name": "danger" } ] }, { "name": "pill", "description": "Draws a pill-style badge with rounded edges.", "values": [] }, { "name": "pulse", "description": "Makes the badge pulsate to draw attention.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/badge" } ] }, { "name": "sl-breadcrumb-item", "description": "Breadcrumb Items are used inside [breadcrumbs](/components/breadcrumb) to represent different links.\n---\n\n\n### **Slots:**\n - _default_ - The breadcrumb item's label.\n- **prefix** - An optional prefix, usually an icon or icon button.\n- **suffix** - An optional suffix, usually an icon or icon button.\n- **separator** - The 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.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **label** - The breadcrumb item's label.\n- **prefix** - The container that wraps the prefix.\n- **suffix** - The container that wraps the suffix.\n- **separator** - The container that wraps the separator.", "attributes": [ { "name": "href", "description": "Optional URL to direct the user to when the breadcrumb item is activated. When set, a link will be rendered\ninternally. When unset, a button will be rendered instead.", "values": [] }, { "name": "target", "description": "Tells the browser where to open the link. Only used when `href` is set.", "values": [ { "name": "_blank" }, { "name": "_parent" }, { "name": "_self" }, { "name": "_top" } ] }, { "name": "rel", "description": "The `rel` attribute to use on the link. Only used when `href` is set.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/breadcrumb-item" } ] }, { "name": "sl-button", "description": "Buttons represent actions that are available to the user.\n---\n\n\n### **Events:**\n - **sl-blur** - Emitted when the button loses focus.\n- **sl-focus** - Emitted when the button gains focus.\n- **sl-invalid** - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\n### **Methods:**\n - **click()** - Simulates a click on the button.\n- **focus(options: _FocusOptions_)** - Sets focus on the button.\n- **blur()** - Removes focus from the button.\n- **checkValidity()** - Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - _default_ - The button's label.\n- **prefix** - A presentational prefix icon or similar element.\n- **suffix** - A presentational suffix icon or similar element.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **prefix** - The container that wraps the prefix.\n- **label** - The button's label.\n- **suffix** - The container that wraps the suffix.\n- **caret** - The button's caret icon, an `<sl-icon>` element.\n- **spinner** - The spinner that shows when the button is in the loading state.", "attributes": [ { "name": "title", "values": [] }, { "name": "variant", "description": "The button's theme variant.", "values": [ { "name": "default" }, { "name": "primary" }, { "name": "success" }, { "name": "neutral" }, { "name": "warning" }, { "name": "danger" }, { "name": "text" } ] }, { "name": "size", "description": "The button's size.", "values": [ { "name": "small" }, { "name": "medium" }, { "name": "large" } ] }, { "name": "caret", "description": "Draws the button with a caret. Used to indicate that the button triggers a dropdown menu or similar behavior.", "values": [] }, { "name": "disabled", "description": "Disables the button.", "values": [] }, { "name": "loading", "description": "Draws the button in a loading state.", "values": [] }, { "name": "outline", "description": "Draws an outlined button.", "values": [] }, { "name": "pill", "description": "Draws a pill-style button with rounded edges.", "values": [] }, { "name": "circle", "description": "Draws a circular icon button. When this attribute is present, the button expects a single `<sl-icon>` in the\ndefault slot.", "values": [] }, { "name": "type", "description": "The type of button. Note that the default value is `button` instead of `submit`, which is opposite of how native\n`<button>` elements behave. When the type is `submit`, the button will submit the surrounding form.", "values": [ { "name": "button" }, { "name": "submit" }, { "name": "reset" } ] }, { "name": "name", "description": "The name of the button, submitted as a name/value pair with form data, but only when this button is the submitter.\nThis attribute is ignored when `href` is present.", "values": [] }, { "name": "value", "description": "The value of the button, submitted as a pair with the button's name as part of the form data, but only when this\nbutton is the submitter. This attribute is ignored when `href` is present.", "values": [] }, { "name": "href", "description": "When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`.", "values": [] }, { "name": "target", "description": "Tells the browser where to open the link. Only used when `href` is present.", "values": [ { "name": "_blank" }, { "name": "_parent" }, { "name": "_self" }, { "name": "_top" } ] }, { "name": "rel", "description": "When using `href`, this attribute will map to the underlying link's `rel` attribute. Unlike regular links, the\ndefault is `noreferrer noopener` to prevent security exploits. However, if you're using `target` to point to a\nspecific tab/window, this will prevent that from working correctly. You can remove or change the default value by\nsetting the attribute to an empty string or a value of your choice, respectively.", "values": [] }, { "name": "download", "description": "Tells the browser to download the linked file as this filename. Only used when `href` is present.", "values": [] }, { "name": "form", "description": "The \"form owner\" to associate the button with. If omitted, the closest containing form will be used instead. The\nvalue of this attribute must be an id of a form in the same document or shadow root as the button.", "values": [] }, { "name": "formaction", "description": "Used to override the form owner's `action` attribute.", "values": [] }, { "name": "formenctype", "description": "Used to override the form owner's `enctype` attribute.", "values": [ { "name": "application/x-www-form-urlencoded" }, { "name": "multipart/form-data" }, { "name": "text/plain" } ] }, { "name": "formmethod", "description": "Used to override the form owner's `method` attribute.", "values": [{ "name": "post" }, { "name": "get" }] }, { "name": "formnovalidate", "description": "Used to override the form owner's `novalidate` attribute.", "values": [] }, { "name": "formtarget", "description": "Used to override the form owner's `target` attribute.", "values": [ { "name": "_self" }, { "name": "_blank" }, { "name": "_parent" }, { "name": "_top" } ] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/button" } ] }, { "name": "sl-button-group", "description": "Button groups can be used to group related buttons into sections.\n---\n\n\n### **Slots:**\n - _default_ - One or more `<sl-button>` elements to display in the button group.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.", "attributes": [ { "name": "label", "description": "A label to use for the button group. This won't be displayed on the screen, but it will be announced by assistive\ndevices when interacting with the control and is strongly recommended.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/button-group" } ] }, { "name": "sl-card", "description": "Cards can be used to group related subjects in a container.\n---\n\n\n### **Slots:**\n - _default_ - The card's main content.\n- **header** - An optional header for the card.\n- **footer** - An optional footer for the card.\n- **image** - An optional image to render at the start of the card.\n\n### **CSS Properties:**\n - **--border-color** - The card's border color, including borders that occur inside the card. _(default: undefined)_\n- **--border-radius** - The border radius for the card's edges. _(default: undefined)_\n- **--border-width** - The width of the card's borders. _(default: undefined)_\n- **--padding** - The padding to use for the card's sections. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **image** - The container that wraps the card's image.\n- **header** - The container that wraps the card's header.\n- **body** - The container that wraps the card's main content.\n- **footer** - The container that wraps the card's footer.", "attributes": [], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/card" } ] }, { "name": "sl-carousel", "description": "Carousels display an arbitrary number of content slides along a horizontal or vertical axis.\n---\n\n\n### **Events:**\n - **sl-slide-change** - Emitted when the active slide changes.\n\n### **Methods:**\n - **previous(behavior: _ScrollBehavior_)** - Move the carousel backward by `slides-per-move` slides.\n- **next(behavior: _ScrollBehavior_)** - Move the carousel forward by `slides-per-move` slides.\n- **goToSlide(index: _number_, behavior: _ScrollBehavior_)** - Scrolls the carousel to the slide specified by `index`.\n\n### **Slots:**\n - _default_ - The carousel's main content, one or more `<sl-carousel-item>` elements.\n- **next-icon** - Optional next icon to use instead of the default. Works best with `<sl-icon>`.\n- **previous-icon** - Optional previous icon to use instead of the default. Works best with `<sl-icon>`.\n\n### **CSS Properties:**\n - **--slide-gap** - The space between each slide. _(default: undefined)_\n- **--aspect-ratio** - The aspect ratio of each slide. _(default: 16/9)_\n- **--scroll-hint** - The amount of padding to apply to the scroll area, allowing adjacent slides to become partially visible as a scroll hint. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The carousel's internal wrapper.\n- **scroll-container** - The scroll container that wraps the slides.\n- **pagination** - The pagination indicators wrapper.\n- **pagination-item** - The pagination indicator.\n- **pagination-item--active** - Applied when the item is active.\n- **navigation** - The navigation wrapper.\n- **navigation-button** - The navigation button.\n- **navigation-button--previous** - Applied to the previous button.\n- **navigation-button--next** - Applied to the next button.", "attributes": [ { "name": "loop", "description": "When set, allows the user to navigate the carousel in the same direction indefinitely.", "values": [] }, { "name": "navigation", "description": "When set, show the carousel's navigation.", "values": [] }, { "name": "pagination", "description": "When set, show the carousel's pagination indicators.", "values": [] }, { "name": "autoplay", "description": "When set, the slides will scroll automatically when the user is not interacting with them.", "values": [] }, { "name": "autoplay-interval", "description": "Specifies the amount of time, in milliseconds, between each automatic scroll.", "values": [] }, { "name": "slides-per-page", "description": "Specifies how many slides should be shown at a given time.", "values": [] }, { "name": "slides-per-move", "description": "Specifies the number of slides the carousel will advance when scrolling, useful when specifying a `slides-per-page`\ngreater than one. It can't be higher than `slides-per-page`.", "values": [] }, { "name": "orientation", "description": "Specifies the orientation in which the carousel will lay out.", "values": [{ "name": "horizontal" }, { "name": "vertical" }] }, { "name": "mouse-dragging", "description": "When set, it is possible to scroll through the slides by dragging them with the mouse.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/carousel" } ] }, { "name": "sl-carousel-item", "description": "A carousel item represent a slide within a [carousel](/components/carousel).\n---\n\n\n### **Slots:**\n - _default_ - The carousel item's content..\n\n### **CSS Properties:**\n - **--aspect-ratio** - The slide's aspect ratio. Inherited from the carousel by default. _(default: undefined)_", "attributes": [], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/carousel-item" } ] }, { "name": "sl-checkbox", "description": "Checkboxes allow the user to toggle an option on or off.\n---\n\n\n### **Events:**\n - **sl-blur** - Emitted when the checkbox loses focus.\n- **sl-change** - Emitted when the checked state changes.\n- **sl-focus** - Emitted when the checkbox gains focus.\n- **sl-input** - Emitted when the checkbox receives input.\n- **sl-invalid** - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\n### **Methods:**\n - **click()** - Simulates a click on the checkbox.\n- **focus(options: _FocusOptions_)** - Sets focus on the checkbox.\n- **blur()** - Removes focus from the checkbox.\n- **checkValidity()** - Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear\nthe custom validation message, call this method with an empty string.\n\n### **Slots:**\n - _default_ - The checkbox's label.\n- **help-text** - Text that describes how to use the checkbox. Alternatively, you can use the `help-text` attribute.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **control** - The square container that wraps the checkbox's checked state.\n- **control--checked** - Matches the control part when the checkbox is checked.\n- **control--indeterminate** - Matches the control part when the checkbox is indeterminate.\n- **checked-icon** - The checked icon, an `<sl-icon>` element.\n- **indeterminate-icon** - The indeterminate icon, an `<sl-icon>` element.\n- **label** - The container that wraps the checkbox's label.\n- **form-control-help-text** - The help text's wrapper.", "attributes": [ { "name": "title", "values": [] }, { "name": "name", "description": "The name of the checkbox, submitted as a name/value pair with form data.", "values": [] }, { "name": "value", "description": "The current value of the checkbox, submitted as a name/value pair with form data.", "values": [] }, { "name": "size", "description": "The checkbox's size.", "values": [ { "name": "small" }, { "name": "medium" }, { "name": "large" } ] }, { "name": "disabled", "description": "Disables the checkbox.", "values": [] }, { "name": "checked", "description": "Draws the checkbox in a checked state.", "values": [] }, { "name": "indeterminate", "description": "Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a \"select\nall/none\" behavior when associated checkboxes have a mix of checked and unchecked states.", "values": [] }, { "name": "form", "description": "By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\nto place the form control outside of a form and associate it with the form that has this `id`. The form must be in\nthe same document or shadow root for this to work.", "values": [] }, { "name": "required", "description": "Makes the checkbox a required field.", "values": [] }, { "name": "help-text", "description": "The checkbox's help text. If you need to display HTML, use the `help-text` slot instead.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/checkbox" } ] }, { "name": "sl-color-picker", "description": "Color pickers allow the user to select a color.\n---\n\n\n### **Events:**\n - **sl-blur** - Emitted when the color picker loses focus.\n- **sl-change** - Emitted when the color picker's value changes.\n- **sl-focus** - Emitted when the color picker receives focus.\n- **sl-input** - Emitted when the color picker receives input.\n- **sl-invalid** - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\n### **Methods:**\n - **focus(options: _FocusOptions_)** - Sets focus on the color picker.\n- **blur()** - Removes focus from the color picker.\n- **getFormattedValue(format: _'hex' | 'hexa' | 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'hsv' | 'hsva'_)** - Returns the current value as a string in the specified format.\n- **checkValidity()** - Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - **label** - The color picker's form label. Alternatively, you can use the `label` attribute.\n\n### **CSS Properties:**\n - **--grid-width** - The width of the color grid. _(default: undefined)_\n- **--grid-height** - The height of the color grid. _(default: undefined)_\n- **--grid-handle-size** - The size of the color grid's handle. _(default: undefined)_\n- **--slider-height** - The height of the hue and alpha sliders. _(default: undefined)_\n- **--slider-handle-size** - The diameter of the slider's handle. _(default: undefined)_\n- **--swatch-size** - The size of each predefined color swatch. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **trigger** - The color picker's dropdown trigger.\n- **swatches** - The container that holds the swatches.\n- **swatch** - Each individual swatch.\n- **grid** - The color grid.\n- **grid-handle** - The color grid's handle.\n- **slider** - Hue and opacity sliders.\n- **slider-handle** - Hue and opacity slider handles.\n- **hue-slider** - The hue slider.\n- **hue-slider-handle** - The hue slider's handle.\n- **opacity-slider** - The opacity slider.\n- **opacity-slider-handle** - The opacity slider's handle.\n- **preview** - The preview color.\n- **input** - The text input.\n- **eye-dropper-button** - The eye dropper button.\n- **eye-dropper-button__base** - The eye dropper button's exported `button` part.\n- **eye-dropper-button__prefix** - The eye dropper button's exported `prefix` part.\n- **eye-dropper-button__label** - The eye dropper button's exported `label` part.\n- **eye-dropper-button__suffix** - The eye dropper button's exported `suffix` part.\n- **eye-dropper-button__caret** - The eye dropper button's exported `caret` part.\n- **format-button** - The format button.\n- **format-button__base** - The format button's exported `button` part.\n- **format-button__prefix** - The format button's exported `prefix` part.\n- **format-button__label** - The format button's exported `label` part.\n- **format-button__suffix** - The format button's exported `suffix` part.\n- **format-button__caret** - The format button's exported `caret` part.", "attributes": [ { "name": "value", "description": "The current value of the color picker. The value's format will vary based the `format` attribute. To get the value\nin a specific format, use the `getFormattedValue()` method. The value is submitted as a name/value pair with form\ndata.", "values": [] }, { "name": "label", "description": "The color picker's label. This will not be displayed, but it will be announced by assistive devices. If you need to\ndisplay HTML, you can use the `label` slot` instead.", "values": [] }, { "name": "format", "description": "The format to use. If opacity is enabled, these will translate to HEXA, RGBA, HSLA, and HSVA respectively. The color\npicker will accept user input in any format (including CSS color names) and convert it to the desired format.", "values": [ { "name": "hex" }, { "name": "rgb" }, { "name": "hsl" }, { "name": "hsv" } ] }, { "name": "inline", "description": "Renders the color picker inline rather than in a dropdown.", "values": [] }, { "name": "size", "description": "Determines the size of the color picker's trigger. This has no effect on inline color pickers.", "values": [ { "name": "small" }, { "name": "medium" }, { "name": "large" } ] }, { "name": "no-format-toggle", "description": "Removes the button that lets users toggle between format.", "values": [] }, { "name": "name", "description": "The name of the form control, submitted as a name/value pair with form data.", "values": [] }, { "name": "disabled", "description": "Disables the color picker.", "values": [] }, { "name": "hoist", "description": "Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n`overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.", "values": [] }, { "name": "opacity", "description": "Shows the opacity slider. Enabling this will cause the formatted value to be HEXA, RGBA, or HSLA.", "values": [] }, { "name": "uppercase", "description": "By default, values are lowercase. With this attribute, values will be uppercase instead.", "values": [] }, { "name": "swatches", "description": "One or more predefined color swatches to display as presets in the color picker. Can include any format the color\npicker can parse, including HEX(A), RGB(A), HSL(A), HSV(A), and CSS color names. Each color must be separated by a\nsemicolon (`;`). Alternatively, you can pass an array of color values to this property using JavaScript.", "values": [{ "name": "string[]" }] }, { "name": "form", "description": "By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\nto place the form control outside of a form and associate it with the form that has this `id`. The form must be in\nthe same document or shadow root for this to work.", "values": [] }, { "name": "required", "description": "Makes the color picker a required field.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/color-picker" } ] }, { "name": "sl-copy-button", "description": "Copies text data to the clipboard when the user clicks the trigger.\n---\n\n\n### **Events:**\n - **sl-copy** - Emitted when the data has been copied.\n- **sl-error** - Emitted when the data could not be copied.\n\n### **Slots:**\n - **copy-icon** - The icon to show in the default copy state. Works best with `<sl-icon>`.\n- **success-icon** - The icon to show when the content is copied. Works best with `<sl-icon>`.\n- **error-icon** - The icon to show when a copy error occurs. Works best with `<sl-icon>`.\n\n### **CSS Properties:**\n - **--success-color** - The color to use for success feedback. _(default: undefined)_\n- **--error-color** - The color to use for error feedback. _(default: undefined)_\n\n### **CSS Parts:**\n - **button** - The internal `<button>` element.\n- **copy-icon** - The container that holds the copy icon.\n- **success-icon** - The container that holds the success icon.\n- **error-icon** - The container that holds the error icon.\n- **tooltip__base** - The tooltip's exported `base` part.\n- **tooltip__base__popup** - The tooltip's exported `popup` part.\n- **tooltip__base__arrow** - The tooltip's exported `arrow` part.\n- **tooltip__body** - The tooltip's exported `body` part.", "attributes": [ { "name": "value", "description": "The text value to copy.", "values": [] }, { "name": "from", "description": "An id that references an element in the same document from which data will be copied. If both this and `value` are\npresent, this value will take precedence. By default, the target element's `textContent` will be copied. To copy an\nattribute, append the attribute name wrapped in square brackets, e.g. `from=\"el[value]\"`. To copy a property,\nappend a dot and the property name, e.g. `from=\"el.value\"`.", "values": [] }, { "name": "disabled", "description": "Disables the copy button.", "values": [] }, { "name": "copy-label", "description": "A custom label to show in the tooltip.", "values": [] }, { "name": "success-label", "description": "A custom label to show in the tooltip after copying.", "values": [] }, { "name": "error-label", "description": "A custom label to show in the tooltip when a copy error occurs.", "values": [] }, { "name": "feedback-duration", "description": "The length of time to show feedback before restoring the default trigger.", "values": [] }, { "name": "tooltip-placement", "description": "The preferred placement of the tooltip.", "values": [ { "name": "top" }, { "name": "right" }, { "name": "bottom" }, { "name": "left" } ] }, { "name": "hoist", "description": "Enable this option to prevent the tooltip from being clipped when the component is placed inside a container with\n`overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all,\nscenarios.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/copy-button" } ] }, { "name": "sl-details", "description": "Details show a brief summary and expand to show additional content.\n---\n\n\n### **Events:**\n - **sl-show** - Emitted when the details opens.\n- **sl-after-show** - Emitted after the details opens and all animations are complete.\n- **sl-hide** - Emitted when the details closes.\n- **sl-after-hide** - Emitted after the details closes and all animations are complete.\n\n### **Methods:**\n - **show()** - Shows the details.\n- **hide()** - Hides the details\n\n### **Slots:**\n - _default_ - The details' main content.\n- **summary** - The details' summary. Alternatively, you can use the `summary` attribute.\n- **expand-icon** - Optional expand icon to use instead of the default. Works best with `<sl-icon>`.\n- **collapse-icon** - Optional collapse icon to use instead of the default. Works best with `<sl-icon>`.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **header** - The header that wraps both the summary and the expand/collapse icon.\n- **summary** - The container that wraps the summary.\n- **summary-icon** - The container that wraps the expand/collapse icons.\n- **content** - The details content.", "attributes": [ { "name": "open", "description": "Indicates whether or not the details is open. You can toggle this attribute to show and hide the details, or you\ncan use the `show()` and `hide()` methods and this attribute will reflect the details' open state.", "values": [] }, { "name": "summary", "description": "The summary to show in the header. If you need to display HTML, use the `summary` slot instead.", "values": [] }, { "name": "disabled", "description": "Disables the details so it can't be toggled.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/details" } ] }, { "name": "sl-dialog", "description": "Dialogs, sometimes called \"modals\", appear above the page and require the user's immediate attention.\n---\n\n\n### **Events:**\n - **sl-show** - Emitted when the dialog opens.\n- **sl-after-show** - Emitted after the dialog opens and all animations are complete.\n- **sl-hide** - Emitted when the dialog closes.\n- **sl-after-hide** - Emitted after the dialog closes and all animations are complete.\n- **sl-initial-focus** - Emitted 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.\n- **sl-request-close** - Emitted 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.\n\n### **Methods:**\n - **show()** - Shows the dialog.\n- **hide()** - Hides the dialog\n\n### **Slots:**\n - _default_ - The dialog's main content.\n- **label** - The dialog's label. Alternatively, you can use the `label` attribute.\n- **header-actions** - Optional actions to add to the header. Works best with `<sl-icon-button>`.\n- **footer** - The dialog's footer, usually one or more buttons representing various options.\n\n### **CSS Properties:**\n - **--width** - The preferred width of the dialog. Note that the dialog will shrink to accommodate smaller screens. _(default: undefined)_\n- **--header-spacing** - The amount of padding to use for the header. _(default: undefined)_\n- **--body-spacing** - The amount of padding to use for the body. _(default: undefined)_\n- **--footer-spacing** - The amount of padding to use for the footer. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **overlay** - The overlay that covers the screen behind the dialog.\n- **panel** - The dialog's panel (where the dialog and its content are rendered).\n- **header** - The dialog's header. This element wraps the title and header actions.\n- **header-actions** - Optional actions to add to the header. Works best with `<sl-icon-button>`.\n- **title** - The dialog's title.\n- **close-button** - The close button, an `<sl-icon-button>`.\n- **close-button__base** - The close button's exported `base` part.\n- **body** - The dialog's body.\n- **footer** - The dialog's footer.", "attributes": [ { "name": "open", "description": "Indicates whether or not the dialog is open. You can toggle this attribute to show and hide the dialog, or you can\nuse the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.", "values": [] }, { "name": "label", "description": "The dialog's label as displayed in the header. You should always include a relevant label even when using\n`no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.", "values": [] }, { "name": "no-header", "description": "Disables the header. This will also remove the default close button, so please ensure you provide an easy,\naccessible way for users to dismiss the dialog.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/dialog" } ] }, { "name": "sl-divider", "description": "Dividers are used to visually separate or group elements.\n---\n\n\n### **CSS Properties:**\n - **--color** - The color of the divider. _(default: undefined)_\n- **--width** - The width of the divider. _(default: undefined)_\n- **--spacing** - The spacing of the divider. _(default: undefined)_", "attributes": [ { "name": "vertical", "description": "Draws the divider in a vertical orientation.", "values": [] } ], "references": [ { "name": "Documentation", "url": "https://shoelace.style/components/divider" } ] }, { "name": "sl-drawer", "description": "Drawers slide in from a container to expose additional options and information.\n---\n\n\n### **Events:**\n - **sl-show** - Emitted when the drawer opens.\n- **sl-after-show** - Emitted after the drawer opens and all animations are complete.\n- **sl-hide** - Emitted when the drawer closes.\n- **sl-after-hide** - Emitted after the drawer closes and all animations are complete.\n- **sl-initial-focus** - Emitted 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.\n- **sl-request-close** - Emitted 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.\n\n### **Methods:**\n - **show()** - Shows the drawer.\n- **hide()** - Hides the drawer\n\n### **Slots:**\n - _default_ - The drawer's main content.\n- **label** - The drawer's label. Alternatively, you can use the `label` attribute.\n- **header-actions** - Optional actions to add to the header. Works best with `<sl-icon-button>`.\n- **footer** - The drawer's footer, usually one or more buttons representing various options.\n\n### **CSS Properties:**\n - **--size** - The 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. _(default: undefined)_\n- **--header-spacing** - The amount of padding to use for the header. _(defau