UNPKG

mdui

Version:

实现 material you 设计规范的 Web Components 组件库

950 lines 690 kB
{ "$schema": "http://json.schemastore.org/web-types", "name": "mdui", "version": "2.1.4", "js-types-syntax": "typescript", "description-markup": "markdown", "framework-config": { "enable-when": { "node-packages": [ "mdui" ] } }, "contributions": { "html": { "elements": [ { "name": "mdui-avatar", "description": "Avatar Component \n\n```html\n<mdui-avatar src=\"https://avatars githubusercontent com/u/3030330?s=40&v=4\"></mdui-avatar>\n```", "attributes": [ { "name": "src", "description": "URL of the avatar image.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#attributes-src" }, { "name": "fit", "description": "Image resizing method, similar to the native CSS [`object-fit`](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit). Possible values:\n\n* `contain`: Scales the image to fit within the box while maintaining the aspect ratio. The image will be \"letterboxed\" if the aspect ratios do not match.\n* `cover`: Scales the image to fill the box while maintaining the aspect ratio. The image will be clipped if the aspect ratios do not match.\n* `fill`: Default. Scales the image to fill the box. The image will be stretched if the aspect ratios do not match.\n* `none`: No resizing.\n* `scale-down`: Scales as if `none` or `contain` were specified, choosing the smaller result.", "value": { "type": [ "'contain'", "'cover'", "'fill'", "'none'", "'scale-down'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#attributes-fit" }, { "name": "icon", "description": "The Material Icons name for the avatar.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#attributes-icon" }, { "name": "label", "description": "Text description of the avatar.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#attributes-label" } ], "priority": "highest", "doc-url": "https://www.mdui.org/en/docs/2/components/avatar", "slots": [ { "name": "", "description": "Custom avatar content, such as letters, `<img>` elements, icons, etc.", "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#slots-default" } ], "js": { "properties": [ { "name": "src", "description": "URL of the avatar image.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#attributes-src" }, { "name": "fit", "description": "Image resizing method, similar to the native CSS [`object-fit`](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit). Possible values:\n\n* `contain`: Scales the image to fit within the box while maintaining the aspect ratio. The image will be \"letterboxed\" if the aspect ratios do not match.\n* `cover`: Scales the image to fill the box while maintaining the aspect ratio. The image will be clipped if the aspect ratios do not match.\n* `fill`: Default. Scales the image to fill the box. The image will be stretched if the aspect ratios do not match.\n* `none`: No resizing.\n* `scale-down`: Scales as if `none` or `contain` were specified, choosing the smaller result.", "value": { "type": [ "'contain'", "'cover'", "'fill'", "'none'", "'scale-down'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#attributes-fit" }, { "name": "icon", "description": "The Material Icons name for the avatar.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#attributes-icon" }, { "name": "label", "description": "Text description of the avatar.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#attributes-label" } ] }, "css": { "properties": [ { "name": "--shape-corner", "description": "The size of the component corner. You can use a specific pixel value, but it's recommended to reference [design tokens](https://www.mdui.org/en/docs/2/styles/design-tokens#shape-corner).", "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#cssProperties-shape-corner" } ], "parts": [ { "name": "image", "description": "Internal `<img>` element when using an image avatar.", "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#cssParts-image" }, { "name": "icon", "description": "Internal `<mdui-icon>` element when using an icon avatar.", "doc-url": "https://www.mdui.org/en/docs/2/components/avatar#cssParts-icon" } ] } }, { "name": "mdui-badge", "description": "Badge Component \n\n```html\n<mdui-badge>12</mdui-badge>\n```", "attributes": [ { "name": "variant", "description": "Defines the badge shape. Possible values:\n* `small`: A small badge without text.\n* `large`: A large badge with displayed text.", "value": { "type": [ "'small'", "'large'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/badge#attributes-variant" } ], "priority": "highest", "doc-url": "https://www.mdui.org/en/docs/2/components/badge", "slots": [ { "name": "", "description": "The text to be displayed.", "doc-url": "https://www.mdui.org/en/docs/2/components/badge#slots-default" } ], "js": { "properties": [ { "name": "variant", "description": "Defines the badge shape. Possible values:\n* `small`: A small badge without text.\n* `large`: A large badge with displayed text.", "value": { "type": [ "'small'", "'large'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/badge#attributes-variant" } ] }, "css": { "properties": [ { "name": "--shape-corner", "description": "The size of the component corner. You can use a specific pixel value, but it's recommended to reference [design tokens](https://www.mdui.org/en/docs/2/styles/design-tokens#shape-corner).", "doc-url": "https://www.mdui.org/en/docs/2/components/badge#cssProperties-shape-corner" } ] } }, { "name": "mdui-bottom-app-bar", "description": "Bottom App Bar Component \n\n```html\n<mdui-bottom-app-bar>\n <mdui-button-icon icon=\"check_box--outlined\"></mdui-button-icon>\n <mdui-button-icon icon=\"edit--outlined\"></mdui-button-icon>\n <mdui-button-icon icon=\"mic_none--outlined\"></mdui-button-icon>\n <mdui-button-icon icon=\"image--outlined\"></mdui-button-icon>\n <div style=\"flex-grow: 1\"></div>\n <mdui-fab icon=\"add\"></mdui-fab>\n</mdui-bottom-app-bar>\n```", "attributes": [ { "name": "hide", "description": "Hides the bottom app bar when set.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-hide" }, { "name": "fab-detach", "description": "When set, detaches the [`<mdui-fab>`](https://www.mdui.org/en/docs/2/components/fab) from the bottom app bar. The [`<mdui-fab>`](https://www.mdui.org/en/docs/2/components/fab) remains on the page even after the app bar is hidden.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-fab-detach" }, { "name": "scroll-behavior", "description": "Defines the scroll behavior. Possible values:\n\n* `hide`: Hides when scrolling.", "value": { "type": [ "'hide'", "'shrink'", "'elevate'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-scroll-behavior" }, { "name": "scroll-target", "description": "The element that listens for scroll events. Accepts a CSS selector, DOM element, or [JQ object](https://www.mdui.org/en/docs/2/functions/jq). Defaults to `window`.", "value": { "type": [ "string", "HTMLElement", "JQ<HTMLElement>" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-scroll-target" }, { "name": "scroll-threshold", "description": "The scroll distance (in pixels) that triggers the scroll behavior.", "value": { "type": "number" }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-scroll-threshold" }, { "name": "order", "description": "Specifies the layout order within the [`<mdui-layout>`](https://www.mdui.org/en/docs/2/components/layout) component. Items are sorted in ascending order. The default value is `0`.", "value": { "type": "number" }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-order" } ], "priority": "highest", "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar", "slots": [ { "name": "", "description": "Elements within the bottom app bar.", "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#slots-default" } ], "js": { "properties": [ { "name": "hide", "description": "Hides the bottom app bar when set.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-hide" }, { "name": "fabDetach", "description": "When set, detaches the [`<mdui-fab>`](https://www.mdui.org/en/docs/2/components/fab) from the bottom app bar. The [`<mdui-fab>`](https://www.mdui.org/en/docs/2/components/fab) remains on the page even after the app bar is hidden.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-fabDetach" }, { "name": "scrollBehavior", "description": "Defines the scroll behavior. Possible values:\n\n* `hide`: Hides when scrolling.", "value": { "type": [ "'hide'", "'shrink'", "'elevate'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-scrollBehavior" }, { "name": "scrollTarget", "description": "The element that listens for scroll events. Accepts a CSS selector, DOM element, or [JQ object](https://www.mdui.org/en/docs/2/functions/jq). Defaults to `window`.", "value": { "type": [ "string", "HTMLElement", "JQ<HTMLElement>" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-scrollTarget" }, { "name": "scrollThreshold", "description": "The scroll distance (in pixels) that triggers the scroll behavior.", "value": { "type": "number" }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-scrollThreshold" }, { "name": "order", "description": "Specifies the layout order within the [`<mdui-layout>`](https://www.mdui.org/en/docs/2/components/layout) component. Items are sorted in ascending order. The default value is `0`.", "value": { "type": "number" }, "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#attributes-order" } ], "events": [ { "name": "show", "description": "Emitted when the bottom app bar starts to show. Can be prevented with `event.preventDefault()`.", "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#events-show" }, { "name": "shown", "description": "Emitted after the bottom app bar has shown and animations are complete.", "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#events-shown" }, { "name": "hide", "description": "Emitted when the bottom app bar starts to hide. Can be prevented with `event.preventDefault()`.", "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#events-hide" }, { "name": "hidden", "description": "Emitted after the bottom app bar has hidden and animations are complete.", "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#events-hidden" } ] }, "css": { "properties": [ { "name": "--shape-corner", "description": "The size of the component corner. You can use a specific pixel value, but it's recommended to reference [design tokens](https://www.mdui.org/en/docs/2/styles/design-tokens#shape-corner).", "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#cssProperties-shape-corner" }, { "name": "--z-index", "description": "The CSS `z-index` value of the component.", "doc-url": "https://www.mdui.org/en/docs/2/components/bottom-app-bar#cssProperties-z-index" } ] } }, { "name": "mdui-button-icon", "description": "Icon Button Component \n\n```html\n<mdui-button-icon icon=\"search\"></mdui-button-icon>\n```", "attributes": [ { "name": "variant", "description": "Defines the icon button style. Possible values:\n* `standard`: For low-priority actions.\n* `filled`: Has the strongest visual effect, suitable for high-priority actions.\n* `tonal`: A visual effect between `filled` and `outlined`, suitable for medium to high-priority actions.\n* `outlined`: For medium-priority actions.", "value": { "type": [ "'standard'", "'filled'", "'tonal'", "'outlined'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-variant" }, { "name": "icon", "description": "Specifies the Material Icons name. Alternatively, use the default slot.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-icon" }, { "name": "selected-icon", "description": "Specifies the Material Icons name when selected. Alternatively, use `slot=\"selected-icon\"`.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-selected-icon" }, { "name": "selectable", "description": "Indicates if the button is selectable.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-selectable" }, { "name": "selected", "description": "Indicates if the button is selected.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-selected" }, { "name": "href", "description": "The URL for the hyperlink. If specified, the component renders as an `<a>` element and can use link-related attributes.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-href" }, { "name": "download", "description": "Instructs the browser to treat the linked URL as a download.\n\n**Note**: This is only available when `href` is specified.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-download" }, { "name": "target", "description": "Defines where to display the linked URL. Possible values:\n\n* `_blank`: Opens in a new tab or window.\n* `_parent`: Opens in the parent browsing context or `_self` if no parent exists.\n* `_self`: Opens in the current browsing context. (Default).\n* `_top`: Opens in the topmost browsing context or `_self` if no ancestors exist.\n\n**Note**: This is only available when `href` is specified.", "value": { "type": [ "'_blank'", "'_parent'", "'_self'", "'_top'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-target" }, { "name": "rel", "description": "Specifies the relationship of the linked URL as space-separated link types. Possible values:\n\n* `alternate`: Alternate versions of the current document.\n* `author`: Author of the current document or article.\n* `bookmark`: Permanent link for the nearest ancestor section.\n* `external`: The referenced document is not part of the same site as the current document.\n* `help`: Link to context-sensitive help.\n* `license`: Indicates that the main content of the current document is covered by the copyright license described by the referenced document.\n* `me`: Indicates that the current document represents the person who owns the linked content.\n* `next`: Indicates that the current document is part of a series and the next document in the series is the referenced document.\n* `nofollow`: Indicates that the current document's original author or publisher does not endorse the referenced document.\n* `noreferrer`: No `Referer` header will be included. Also has the same effect as `noopener`.\n* `opener`: Creates an auxiliary browsing context if the hyperlink would otherwise create a top-level browsing context that is not an auxiliary browsing context (i.e., has \"`_blank`\" as `target` attribute value).\n* `prev`: Indicates that the current document is part of a series and the previous document in the series is the referenced document.\n* `search`: Links to a resource that can be used to search through the current document and its related pages.\n* `tag`: Gives a tag (identified by the given address) that applies to the current document.\n\n**Note**: This is only available when `href` is specified.", "value": { "type": [ "'alternate'", "'author'", "'bookmark'", "'external'", "'help'", "'license'", "'me'", "'next'", "'nofollow'", "'noreferrer'", "'opener'", "'prev'", "'search'", "'tag'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-rel" }, { "name": "autofocus", "description": "Determines if the element should be focused when the page loads.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-autofocus" }, { "name": "tabindex", "description": "Specifies the order in which the element receives focus when navigating with the Tab key.", "value": { "type": "number" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-tabindex" }, { "name": "disabled", "description": "Disables the element.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-disabled" }, { "name": "loading", "description": "Indicates that the element is in a loading state.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-loading" }, { "name": "name", "description": "The button's name, which is submitted with form data.\n\n**Note**: This is only available when `href` is not specified.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-name" }, { "name": "value", "description": "The button's value, which is submitted with form data.\n\n**Note**: This is only available when `href` is not specified.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-value" }, { "name": "type", "description": "Defines the button's default behavior. The default is `button`. Possible values:\n\n* `submit`: Submits the form data to the server.\n* `reset`: Resets all the controls to their initial values.\n* `button`: No default behavior, does nothing when pressed by default.\n\n**Note**: This is only available when `href` is not specified.", "value": { "type": [ "'submit'", "'reset'", "'button'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-type" }, { "name": "form", "description": "Associates the button with a `<form>` element. The value should be the `id` of a `<form>` in the same document. If not set, the button is associated with its parent `<form>`, if any.\n\nThis attribute allows button elements to be associated with `<form>`s anywhere in the document, not just inside a `<form>`.\n\n**Note**: Only available when `href` is not specified.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-form" }, { "name": "formaction", "description": "Specifies the URL that processes the button's submitted information. Overrides the `action` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formaction" }, { "name": "formenctype", "description": "Specifies the form data encoding method. Possible values:\n\n* `application/x-www-form-urlencoded`: Default if the attribute is not used.\n* `multipart/form-data`: Used for `<input>` elements with `type` set to `file`.\n* `text/plain`: For debugging, not for real form submission.\n\nOverrides the `enctype` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": [ "'application/x-www-form-urlencoded'", "'multipart/form-data'", "'text/plain'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formenctype" }, { "name": "formmethod", "description": "Specifies the HTTP method for form submission. Possible values:\n\n* `post`: Form data included in HTTP request body.\n* `get`: Form data appended to `action` URL.\n\nOverrides the `method` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": [ "'post'", "'get'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formmethod" }, { "name": "formnovalidate", "description": "Specifies that the form should not be validated on submission. Overrides the `novalidate` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formnovalidate" }, { "name": "formtarget", "description": "Specifies where to display the form submission response. Possible values:\n\n* `_self`: Current browsing context. (Default).\n* `_blank`: New tab or window.\n* `_parent`: Parent browsing context or `_self` if no parent.\n* `_top`: Topmost browsing context or `_self` if no ancestors.\n\nOverrides the `target` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": [ "'_self'", "'_blank'", "'_parent'", "'_top'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formtarget" } ], "priority": "highest", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon", "slots": [ { "name": "", "description": "Icon component.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#slots-default" }, { "name": "selected-icon", "description": "Icon in the selected state.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#slots-selected-icon" } ], "js": { "properties": [ { "name": "variant", "description": "Defines the icon button style. Possible values:\n* `standard`: For low-priority actions.\n* `filled`: Has the strongest visual effect, suitable for high-priority actions.\n* `tonal`: A visual effect between `filled` and `outlined`, suitable for medium to high-priority actions.\n* `outlined`: For medium-priority actions.", "value": { "type": [ "'standard'", "'filled'", "'tonal'", "'outlined'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-variant" }, { "name": "icon", "description": "Specifies the Material Icons name. Alternatively, use the default slot.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-icon" }, { "name": "selectedIcon", "description": "Specifies the Material Icons name when selected. Alternatively, use `slot=\"selected-icon\"`.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-selectedIcon" }, { "name": "selectable", "description": "Indicates if the button is selectable.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-selectable" }, { "name": "selected", "description": "Indicates if the button is selected.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-selected" }, { "name": "href", "description": "The URL for the hyperlink. If specified, the component renders as an `<a>` element and can use link-related attributes.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-href" }, { "name": "download", "description": "Instructs the browser to treat the linked URL as a download.\n\n**Note**: This is only available when `href` is specified.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-download" }, { "name": "target", "description": "Defines where to display the linked URL. Possible values:\n\n* `_blank`: Opens in a new tab or window.\n* `_parent`: Opens in the parent browsing context or `_self` if no parent exists.\n* `_self`: Opens in the current browsing context. (Default).\n* `_top`: Opens in the topmost browsing context or `_self` if no ancestors exist.\n\n**Note**: This is only available when `href` is specified.", "value": { "type": [ "'_blank'", "'_parent'", "'_self'", "'_top'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-target" }, { "name": "rel", "description": "Specifies the relationship of the linked URL as space-separated link types. Possible values:\n\n* `alternate`: Alternate versions of the current document.\n* `author`: Author of the current document or article.\n* `bookmark`: Permanent link for the nearest ancestor section.\n* `external`: The referenced document is not part of the same site as the current document.\n* `help`: Link to context-sensitive help.\n* `license`: Indicates that the main content of the current document is covered by the copyright license described by the referenced document.\n* `me`: Indicates that the current document represents the person who owns the linked content.\n* `next`: Indicates that the current document is part of a series and the next document in the series is the referenced document.\n* `nofollow`: Indicates that the current document's original author or publisher does not endorse the referenced document.\n* `noreferrer`: No `Referer` header will be included. Also has the same effect as `noopener`.\n* `opener`: Creates an auxiliary browsing context if the hyperlink would otherwise create a top-level browsing context that is not an auxiliary browsing context (i.e., has \"`_blank`\" as `target` attribute value).\n* `prev`: Indicates that the current document is part of a series and the previous document in the series is the referenced document.\n* `search`: Links to a resource that can be used to search through the current document and its related pages.\n* `tag`: Gives a tag (identified by the given address) that applies to the current document.\n\n**Note**: This is only available when `href` is specified.", "value": { "type": [ "'alternate'", "'author'", "'bookmark'", "'external'", "'help'", "'license'", "'me'", "'next'", "'nofollow'", "'noreferrer'", "'opener'", "'prev'", "'search'", "'tag'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-rel" }, { "name": "autofocus", "description": "Determines if the element should be focused when the page loads.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-autofocus" }, { "name": "tabIndex", "description": "Specifies the order in which the element receives focus when navigating with the Tab key.", "value": { "type": "number" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-tabIndex" }, { "name": "disabled", "description": "Disables the element.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-disabled" }, { "name": "loading", "description": "Indicates that the element is in a loading state.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-loading" }, { "name": "name", "description": "The button's name, which is submitted with form data.\n\n**Note**: This is only available when `href` is not specified.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-name" }, { "name": "value", "description": "The button's value, which is submitted with form data.\n\n**Note**: This is only available when `href` is not specified.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-value" }, { "name": "type", "description": "Defines the button's default behavior. The default is `button`. Possible values:\n\n* `submit`: Submits the form data to the server.\n* `reset`: Resets all the controls to their initial values.\n* `button`: No default behavior, does nothing when pressed by default.\n\n**Note**: This is only available when `href` is not specified.", "value": { "type": [ "'submit'", "'reset'", "'button'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-type" }, { "name": "form", "description": "Associates the button with a `<form>` element. The value should be the `id` of a `<form>` in the same document. If not set, the button is associated with its parent `<form>`, if any.\n\nThis attribute allows button elements to be associated with `<form>`s anywhere in the document, not just inside a `<form>`.\n\n**Note**: Only available when `href` is not specified.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-form" }, { "name": "formAction", "description": "Specifies the URL that processes the button's submitted information. Overrides the `action` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formAction" }, { "name": "formEnctype", "description": "Specifies the form data encoding method. Possible values:\n\n* `application/x-www-form-urlencoded`: Default if the attribute is not used.\n* `multipart/form-data`: Used for `<input>` elements with `type` set to `file`.\n* `text/plain`: For debugging, not for real form submission.\n\nOverrides the `enctype` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": [ "'application/x-www-form-urlencoded'", "'multipart/form-data'", "'text/plain'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formEnctype" }, { "name": "formMethod", "description": "Specifies the HTTP method for form submission. Possible values:\n\n* `post`: Form data included in HTTP request body.\n* `get`: Form data appended to `action` URL.\n\nOverrides the `method` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": [ "'post'", "'get'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formMethod" }, { "name": "formNoValidate", "description": "Specifies that the form should not be validated on submission. Overrides the `novalidate` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formNoValidate" }, { "name": "formTarget", "description": "Specifies where to display the form submission response. Possible values:\n\n* `_self`: Current browsing context. (Default).\n* `_blank`: New tab or window.\n* `_parent`: Parent browsing context or `_self` if no parent.\n* `_top`: Topmost browsing context or `_self` if no ancestors.\n\nOverrides the `target` attribute of the button's form owner.\n\n**Note**: Only available when `href` is not specified and `type=\"submit\"`.", "value": { "type": [ "'_self'", "'_blank'", "'_parent'", "'_top'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-formTarget" }, { "name": "validity", "description": "A [`ValidityState`](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) object that represents the element's validity states.", "value": { "type": "ValidityState" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-validity" }, { "name": "validationMessage", "description": "The element's validation message. This is empty if the element meets its constraints.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#attributes-validationMessage" } ], "events": [ { "name": "focus", "description": "Emitted when the button gains focus.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#events-focus" }, { "name": "blur", "description": "Emitted when the button loses focus.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#events-blur" }, { "name": "change", "description": "Emitted when the selected state changes.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#events-change" }, { "name": "invalid", "description": "Emitted when the form control's validity is checked and it doesn't meet the constraints.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#events-invalid" } ] }, "css": { "properties": [ { "name": "--shape-corner", "description": "The size of the component corner. You can use a specific pixel value, but it's recommended to reference [design tokens](https://www.mdui.org/en/docs/2/styles/design-tokens#shape-corner).", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#cssProperties-shape-corner" } ], "parts": [ { "name": "button", "description": "Internal `<button>` or `<a>` element.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#cssParts-button" }, { "name": "icon", "description": "Icon.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#cssParts-icon" }, { "name": "selected-icon", "description": "Icon in the selected state.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#cssParts-selected-icon" }, { "name": "loading", "description": "The `<mdui-circular-progress>` element for the loading state.", "doc-url": "https://www.mdui.org/en/docs/2/components/button-icon#cssParts-loading" } ] } }, { "name": "mdui-button", "description": "Button Component \n\n```html\n<mdui-button>Button</mdui-button>\n```", "attributes": [ { "name": "variant", "description": "Defines the button style. Possible values:\n* `elevated`: A shadowed button for visual distinction.\n* `filled`: Used for final actions like 'Save' or 'Confirm'.\n* `tonal`: A mix between `filled` and `outlined`, suitable for medium to high-priority actions.\n* `outlined`: A bordered button for medium-priority and secondary actions.\n* `text`: A text button for low-priority actions.", "value": { "type": [ "'elevated'", "'filled'", "'tonal'", "'outlined'", "'text'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button#attributes-variant" }, { "name": "full-width", "description": "If set, the button will fill the width of its parent element.", "value": { "type": "boolean" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button#attributes-full-width" }, { "name": "icon", "description": "Specifies the Material Icons name on the left. Alternatively, use `slot=\"icon\"`.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button#attributes-icon" }, { "name": "end-icon", "description": "Specifies the Material Icons name on the right. Alternatively, use `slot=\"end-icon\"`.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button#attributes-end-icon" }, { "name": "href", "description": "The URL for the hyperlink. If provided, the component is rendered as an `<a>` element and can use link-related attributes.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button#attributes-href" }, { "name": "download", "description": "Instructs the browser to download the linked URL.\n\n**Note**: This is only available when `href` is specified.", "value": { "type": "string" }, "doc-url": "https://www.mdui.org/en/docs/2/components/button#attributes-download" }, { "name": "target", "description": "Defines where to open the linked URL. Possible values:\n\n* `_blank`: Opens in a new tab or window.\n* `_parent`: Opens in the parent browsing context or `_self` if no parent.\n* `_self`: Opens in the current browsing context. (Default).\n* `_top`: Opens in the topmost browsing context or `_self` if no ancestors.\n\n**Note**: This is only available when `href` is specified.", "value": { "type": [ "'_blank'", "'_parent'", "'_self'", "'_top'" ] }, "doc-url": "https://www.mdui.org/en/docs/2/components/button#attributes-target" }, { "name": "rel", "description": "Specifies the relationship of the linked URL as space-separated link types. Possible values:\n\n* `alternate`: Alternate versions of the current do