diff --git a/docs/src/pages/components/Button.svx b/docs/src/pages/components/Button.svx index 953d1e0c..f0c7de69 100644 --- a/docs/src/pages/components/Button.svx +++ b/docs/src/pages/components/Button.svx @@ -4,57 +4,73 @@ import TrashCan from "carbon-icons-svelte/lib/TrashCan.svelte"; import Login from "carbon-icons-svelte/lib/Login.svelte"; import Preview from "../../components/Preview.svelte"; - - let index = 1; +Buttons trigger actions in the interface. Use them to submit forms, navigate between pages, or perform specific tasks. Choose from different styles and sizes to match the importance and context of each action. + ## Primary button +The default button style is primary. This should be used for primary actions. + ## Secondary button +Set `kind="secondary"` for secondary actions. + ## Tertiary button +Set `kind="tertiary"` for tertiary actions. + ## Ghost button +Set `kind="ghost"` for ghost-style buttons. + ## Danger button +Set `kind="danger"` for destructive actions. + ## Danger tertiary button +Set `kind="danger-tertiary"` for less prominent destructive actions. + ## Danger tertiary, icon-only button
- You must provide an iconDescription for the button tooltip. + Provide an iconDescription for accessibility. This text will be used as the button's tooltip and screen reader label.
- ## Button with icon +Add an icon to the button using the `icon` prop. + ## Icon-only button
- You must provide an iconDescription for the button tooltip. + Provide an iconDescription for accessibility. This text will be used as the button's tooltip and screen reader label.
@@ -62,11 +78,13 @@ ## Icon-only, link button +Set `href` to create an icon-only link button. + ## Link button with icon +Similarly, link buttons can have icons. + ## Custom element By default, the `Button` will render either a `button` or `a` element. -If you need to render a different element, set `as` to `true` and spread `let:props` to the element. +To render a different element, set `as` to `true` and spread `let:props` to the element. @@ -106,6 +130,8 @@ If you need to render a different element, set `as` to `true` and spread `let:pr ## Small size +Set `size="small"` for small buttons. + @@ -114,6 +140,8 @@ If you need to render a different element, set `as` to `true` and spread `let:pr ## Large size +Set `size="lg"` for large buttons. + @@ -122,6 +150,8 @@ If you need to render a different element, set `as` to `true` and spread `let:pr ## Extra-large size +Set `size="xl"` for extra-large buttons. + @@ -130,6 +160,8 @@ If you need to render a different element, set `as` to `true` and spread `let:pr ## Disabled state +Set `disabled` to disable the button. +