-
-```html
-SUCCESS
-WARNING
-DANGER
-INFO
-NEUTRAL
-DEFAULT
-```
-
-### isBordered
-
-Use the `isBordered` prop for bordered badges. The border color matches the text color by default.
-
-
- SUCCESS
- WARNING
- DANGER
- INFO
- NEUTRAL
- DEFAULT
+KBadge component takes one of the following appearance values:
+
+| Standard | Methods |
+| ------------ | --------- |
+| `info` | `connect` |
+| `success` | `custom` |
+| `warning` | `delete` |
+| `danger` | `get` |
+| `decorative` | `head` |
+| `neutral` | `options` |
+| | `patch` |
+| | `post` |
+| | `put` |
+| | `trace` |
+
+:::tip TIP
+Passing one of the methods appearances will apply `text-transform: uppercase` and set the `min-width` on the badge container. You may pass `custom` to apply method badge styling should you need a badge for your custom method.
+:::
+
+
```html
-SUCCESS
-WARNING
-DANGER
-INFO
-NEUTRAL
-DEFAULT
+Info
+Success
+Warning
+Danger
+Decorative
+Neutral
+Connect
+Custom
+Delete
+Get
+Head
+Options
+Patch
+Post
+Put
+Trace
```
-### shape
+### tooltip
-The Badge has two shapes that can be changed with a `shape` property.
+Provide a `string` of tooltip text that will be shown on badge hover.
-- `rounded` - Default
-- `rectangular`
-
-
- Round
- Rectangular
-
+
+ Published
+
```html
-Round
-Rectangular
+
+ Published
+
```
-### color
-
-Use this prop to modify the badge text color
-
-### backgroundColor
+### truncationTooltip
-Use this prop to modify the background color of the badge
+A `boolean` to conditionally display the [`tooltip`](#tooltip) only when the badge text is truncated. Defaults to `false`. See [`maxWidth` prop](#maxwidth) to learn more about badge truncation.
```html
-Custom
-Badge
-Hello
-Something
-Long Badge 236bfb09-fe79-4cc9-99be-9361d6b1db64 aa07575b-bcd3-4bb2-bfd7-998224e3d31e 364b78fc-dba3-4b94-9134-388515496de5
-```
-### borderColor
-
-Use this prop in conjunction with the `is-bordered` prop to customize the color of the badge border.
-
-
- Organization Admin
+
+ Id: 8ba8840f-ded7-457a-adb9-0ef15b6fb919
-
-```html
-
- Organization Admin
+
+ Last updated: null
```
-### hoverColor
+### maxWidth
-Use this prop in conjunction with the `dismissable` prop to customize the color of the badge/dismiss button when hovered.
+A `string`, in pixels, to limit the badge width and truncate the text. Works just like `max-width` property in CSS. Default value is `200px`. Text content that is wider than the provided value will be truncated.
-
- Production
+
+ Very long text that should be truncated but isn't thanks to max-width="auto"
```html
-
- Production
+
+ Very long text that should be truncated but isn't thanks to max-width="auto"
```
-The `hoverColor` is also utilized if you wrap the `KBadge` with an anchor tag, or add a `@click` listener directly to the component.
+### iconBefore
-
- Anchor Tag
-
+The [`icon` slot](#icon) content is displayed before the badge text by default. Pass `false` to the `iconBefore` prop to render the icon after the badge text.
-{{ myClicks }} clicks
-Click me!
+
+
+ Badge with icon
+
+
+
+
+
+
+
+
+ 4
+
+
```html
-Anchor Tag
-
-{{ myClicks }} clicks
-
- Click me!
+
+ Badge with icon
+
+
+
+
+
+
+
+
+ 4
```
-### dismissable
+## Slots
+
+### default
-Use this prop if you want the badge to be dismissable. If the badge text is long enough to need truncation, the label will truncate; the dismiss button is always visible.
-The color of the dismiss button is determined by the badge type and uses the same theming variables as the badge text. Clicking the dismiss button will trigger a `dismissed` event.
+The badge content.
-
- Close me
- No, close me!
-
+Success
```html
-Close me
-No, close me!
+Success
```
-### truncationTooltip
+### icon
-Use this prop if you would like to conditionally display a tooltip when the badge text is truncated.
+Used to pass an icon or (other element) into the badge. Positioning (whether this slot content is rendered before or after the badge content) is configured with the [`iconBefore` prop](#iconbefore).
- Truncation unnecessary
- Hey! Let me see that awesome truncation
+
+
+
+
+ 4
+
+
+ Badge with icon
+
+
+
+
```html
-Truncation unnecessary
-Hey! Let me see that awesome truncation
-```
-
-### forceTooltip
-
-If you want to show the tooltip regardless of whether the badge text is truncated, use this prop.
-
-Truncation unnecessary
-
-```html
-Truncation unnecessary
+
+
+
+
+ 4
+
+
+ Badge with icon
+
+
+
+
```
-### maxWidth
-
-Max width to apply truncation at. Works just like `width` property in CSS. Default value is `200px`. Is superseded by `--KBadgeMaxWidth` [CSS variable](#theming) if both present.
-
-Truncate early
+:::tip TIP
+To make an icon clickable, you **must** assign an attribute of `role="button"` and `tabindex="0"` attributes to the clickable element and bind an event handler. KBadge will take care of the state styling (hover, focus, and disabled).
+
+
+
+
+ Dismiss me
+
+
+
+
+ Reset
+
+
-```html
-Truncate early
-```
+```vue
+
+
+ Dismiss me
+
+
+
+
+
-## Slots
+
+:::
-```html
-SUCCESS
-```
+KBadge takes care of icon color, size and spacing as long as you use icons sourced from [@kong/icons](https://github.com/Kong/icons) package.
-## Events
+:::tip TIP
+Should you decide to use your own custom icons, you can use design tokens exported by the [@kong/design-tokens](https://github.com/Kong/design-tokens) package to set icon size. The recommended icon size is `16px` or `kui-icon-size-30`.
-| Event | Action |
-| :---------- | :---------------------------------------------------------- |
-| `dismissed` | When `dismissable` is true and you click the dismiss button |
+We also recommend setting the icon style `color` property to a value of `currentColor` to utilize default KBadge styling for slotted content.
+:::
diff --git a/docs/components/dropdown.md b/docs/components/dropdown.md
index 34f8bacace..c1ab7def1d 100644
--- a/docs/components/dropdown.md
+++ b/docs/components/dropdown.md
@@ -486,9 +486,9 @@ const actionClickHandler = (closeDropdown: () => void): void => {
```
:::tip TIP
-If you want to make an icon slotted into KDropdownItem clickable (like the one next to button with action in the example above), you can assign `role="button"` and appropriate `tabindex` attributes to that element and bind an event handler (note that you will have to use `.stop` [event modifier](https://vuejs.org/guide/essentials/event-handling.html#event-modifiers)).
+If you want to make an icon slotted into KDropdownItem clickable (like the one next to button with action in the example above), you can assign `role="button"` and `tabindex="0"` attributes to that element and bind an event handler (note that you will have to use `.stop` [event modifier](https://vuejs.org/guide/essentials/event-handling.html#event-modifiers)).
-If implemented as described here, KDropdownItem will take care of styling the different states (hover, active, disabled). Also note that you will have to trigger closing the dropdown via the `closeDropdown()` slot prop.
+If implemented as described here, KDropdownItem will take care of styling the different states (hover, focus, disabled). Also note that you will have to trigger closing the dropdown via the `closeDropdown()` slot prop.
:::
### Attribute Binding
diff --git a/docs/components/input-switch.md b/docs/components/input-switch.md
index 71ca0b14c5..a68cec5fc6 100644
--- a/docs/components/input-switch.md
+++ b/docs/components/input-switch.md
@@ -1,224 +1,133 @@
# Input Switch
-**KInputSwitch** is used a like checkbox and is meant to toggle settings on and off.
+KInputSwitch, similar to a checkbox, is used to toggle a value on and off.
-
+
```html
-
-
-
-
-
+
```
## Props
-### v-model - required
+### v-model
-Use `v-model` to bind to the `checked` state of the underlying ``. The `v-model` binds to the `value` prop of the component and sets current checked state of toggle switch. You can read more about passing values via `v-model` [here](https://vuejs.org/guide/components/events.html#usage-with-v-model).
+Value to bind to the KInputSwitch.
+
+
```html
-
+
```
### label
-Will place label text to the right of the switch. Can also be [slotted](#slots).
+A `string` of text to display as a label after the input switch. The label can also be [slotted](#slots).
+
+
```html
-
+
```
-
+### labelBefore
-### labelPosition
+A `boolean` to place the label before the input switch. Defaults to `false`.
-Position the label to the left or right of the switch, default to `right`.
-
-
-
-
-
+
```html
-
-
+
```
-### disabled
+### size
+
+KInputSwitch comes in two sizes: `small` (default) and `large`.
-You can add `disabled` to the input to disallow interactivity.
+
+
+
+
```html
-
+
+
```
-
-
### disabledTooltipText
-You can specify tooltip text to be displayed when the switch is disabled.
+Use this prop to display tooltip text when KInputSwitch is disabled.
+
+
```html
-
+
```
-
+### HTML Attributes
-### enabledIcon
-
-Display a check icon when switch is enabled
-
-```html
-
-```
+#### disabled
-
+You can add the `disabled` attribute to disallow interactivity.
-Display a check icon when switch is enabled with label positioned to the left
+
```html
-
+
```
-
-
## Slots
-- `label`
+### label
+
+Provide slotted content for the input switch label. This slot takes precedence over the `label` prop if both are provided.
-
-
- {{ labelText}}
+
+
+ Slotted label
```html
-
-
- {{ labelText }}
+
+
+ Slotted label
-
-
```
## Events
-To listen for changes to the `KInputSwitch` value, you can bind to the `@input`, `@change`, or `@update:modelValue` events:
+KInputSwitch emits a few events with the same payload.
-
-
-
-
-
+### input and update:modelValue
-```html
-
- eventsSwitchEnabled = newValue"
- />
-
-```
+Payload is input value (`boolean`).
-`KInputSwitch` transparently binds to events:
+### change
-
-
- (data.changeCount++)" label="Toggle Me" />
-
You've toggled me {{ data.changeCount }} time(s)
-
-
+Payload is a `boolean` indicating the toggle value.
-```html
-
-
- (changeCount++)" label="Toggle Me" />
-
You've toggled me {{ changeCount }} time(s)
-
-
-```
+
+
+
diff --git a/docs/components/input.md b/docs/components/input.md
index d8fdcdcd5f..5abfbdca8c 100644
--- a/docs/components/input.md
+++ b/docs/components/input.md
@@ -214,7 +214,7 @@ Use the `before` and `after` slots for inserting icons before and/or after the i
```
:::tip TIP
-If you want to make an icon clickable, you can assign `role="button"` and appropriate `tabindex` attributes to that element and bind an event handler. KInput will take care of state styling (hover, active, disabled).
+If you want to make an icon clickable, you **must** assign `role="button"` and `tabindex="0"` attributes to that element and bind an event handler. KBadge will take care of state styling (hover, focus, disabled).
diff --git a/docs/components/method-badge.md b/docs/components/method-badge.md
deleted file mode 100644
index 4086146010..0000000000
--- a/docs/components/method-badge.md
+++ /dev/null
@@ -1,103 +0,0 @@
-# MethodBadge
-
-**KMethodBadge** is a component that provides pre-configured styles for displaying HTTP request methods like `GET`, `POST`, etc. It simplifies the process of showcasing different methods in a visually appealing and consistent manner.
-
-
-
-```html
-
-```
-
-## Props
-
-### method
-
-Method the component should display. Supported methods:
-
-- `get`
-- `post`
-- `put`
-- `patch`
-- `delete`
-- `head`
-- `options`
-- `trace`
-- `connect`
-- `custom` (for any custom methods)
-
-This prop is required.
-
-
-
-
-
-```html
-
-
-
-```
-
-### label
-
-KMethodBadge automatically displays method passed through [`method`](#method-1) prop in uppercase, but in case you are displaying any custom methods, you can use this prop.
-
-
-
-```html
-
-```
-
-### isRounded
-
-When `true`, the badge is rounded.
-
-
-
-
-
-
-```html
-
-
-```
-### isToggle
-
-When `true`, the KMethodBadge will come with a switch input. You can use `v-model` to bind the value to the switch.
-
-
-
-
Post method enabled: {{ toggleValue }}
-
-
-
-
-```html
-
-
-
-```
-
-
-
-
diff --git a/docs/components/truncate.md b/docs/components/truncate.md
index f07b769205..2a2ad581a0 100644
--- a/docs/components/truncate.md
+++ b/docs/components/truncate.md
@@ -3,13 +3,11 @@
**KTruncate** - A Kongponent that limits content to a specific number of lines and provides controls to show or hide the truncated content.
-
-
-
- Item {{ n }}
-
-
-
+
+
+ Item {{ n }}
+
+
```html
@@ -29,13 +27,11 @@
Number of rows to truncate content. Default value is `1`.
-
-
-
- Item {{ n }}
-
-
-
+
+
+ Item {{ n }}
+
+
```html
@@ -55,12 +51,10 @@ By default the component treats anything passed through the `default` slot as co
When this prop is set to `true`, the component applies different logic; truncation is achieved via the `-webkit-line-clamp` CSS property, rather than assessing the height of child elements to determine the row height.
-
-
-
A good design decision to apply text truncation would be when displaying a large amount of textual content, such as a list of articles or product descriptions, in a limited space, such as a mobile screen or a small widget. By truncating the text to a short summary, it is possible to present the information in a more organized and readable manner, allowing the user to quickly scan and understand the main points of each item.
-
The truncated text can also serve as a teaser, encouraging the user to click or tap to view the full content.
-
-
+
+
A good design decision to apply text truncation would be when displaying a large amount of textual content, such as a list of articles or product descriptions, in a limited space, such as a mobile screen or a small widget. By truncating the text to a short summary, it is possible to present the information in a more organized and readable manner, allowing the user to quickly scan and understand the main points of each item.
+
The truncated text can also serve as a teaser, encouraging the user to click or tap to view the full content.
+
```html
@@ -83,13 +77,11 @@ When this prop is set to `true`, the component applies different logic; truncati
When `true`, the component will not truncate the content and the collapse trigger will be visible.
-
-
-
- Item {{ n }}
-
-
-
+
+
+ Item {{ n }}
+
+
```html
@@ -107,11 +99,9 @@ When `true`, the component will not truncate the content and the collapse trigge
Width of container element that wraps content passed through the `default` slot. Works just like `width` property in CSS. Default value is `100%`.
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
```html
@@ -135,13 +125,11 @@ The component is reactive to its dimensions changes. To see this in action, try
:::
-
-
-
- Item {{ n }}
-
-
-
+
+
+ Item {{ n }}
+
+
### expand-trigger
@@ -160,19 +148,17 @@ Slot for a custom collapse trigger element. Slot props:
Example of using the `expand-trigger` and `collapse-trigger` slots for creating custom toggle elements:
-
-
-
- Item {{ n }}
-
-
-
-
-
-
-
-
-
+
+
+ Item {{ n }}
+
+
+
+
+
+
+
+
```html
diff --git a/docs/guide/migrating-to-version-9.md b/docs/guide/migrating-to-version-9.md
index 9759b042a2..70891ca5bb 100644
--- a/docs/guide/migrating-to-version-9.md
+++ b/docs/guide/migrating-to-version-9.md
@@ -30,13 +30,36 @@ Kongponents styles are no longer designed to be utilized standalone, separately
### KBadge
+#### Props
+
+* `appearance` prop no longer accepts `default` and `custom` values (defaults to `info` now)
+* `isBordered` prop has been removed
+* `shape` prop has been removed (now KBadge only comes in one what used to be `rectangular` shape)
+* `borderColor` prop has been removed
+* `backgroundColor` prop has beed removed
+* `color` prop has been removed
+* `dismissable` prop has been removed. You can now pass a clickable close icon (remember to add `role="button"` and `tabindex="0"` attributes) through the `icon` slot and handle KBadge showing/hiding from your host app
+* `hoverColor` prop has been removed
+* `truncationTooltip` prop has been changed to `boolean`. When used in conjunction with new `tooltip` prop, KBadge will only show the tooltip when content passed through the `default` slot needs truncation. Otherwise, if `tooltip` prop is used without `truncationTooltip` prop - tooltip will be shown regardless of whether truncation is needed
+* `forceTooltip` prop has been removed
+
#### Structure
+* dynamic `k-badge-*` classes have been removed
+* `k-badge-text` class has been changed to `badge-content-wrapper`
+* KIcon element that previously contained class `k-badge-dismiss-button` has been removed
+
#### Constants, Types & Interfaces
-#### Props
+* `BadgeAppearances` const no longer contains `default` and `custom` values
+* `BadgeAppearance` type no longer contains `default` and `custom` values
+* `BadgeShapes` const has been removed
+* `BadgeShape` type has been removed
+* `BadgeShapeRecord` type has been removed
-#### Slots
+#### Events
+
+* `dismissed` even has been removed
### KBreadcrumbs
@@ -236,6 +259,17 @@ Component has been renamed to `KDropdown`
### KInputSwitch
+#### Props
+
+* `labelPosition` prop has been removed. Please use `labelBefore` prop instead
+* `enabledIcon` prop has been removed
+
+#### Structure
+
+* `k-switch` class has been removed
+* `switch-with-icon` class has been removed
+* `has-label-right` and `has-label-left` classes were removed
+
### KLabel
#### Props
@@ -250,7 +284,14 @@ Component has been renamed to `KDropdown`
### KMenu
-### KMethod Badge
+### KMethodBadge
+
+This component has been removed. Please refer to KBadge component which has been updated to support method appearances.
+
+#### Constants, Types & Interfaces
+
+* `MethodShape`, `Method` and `MethodBadgeColors` types have been removed
+* `MethodsArray` const has been removed
### KModal
diff --git a/sandbox/index.ts b/sandbox/index.ts
index 990ca86b20..3f59b7a134 100644
--- a/sandbox/index.ts
+++ b/sandbox/index.ts
@@ -17,12 +17,14 @@ app.component('SandboxLayout', SandboxLayout)
// Define the sandbox layout links here to inject
const sandboxAppLinks: SandboxNavigationItem[] = ([
{ name: 'KAlert', to: { name: 'alert' } },
+ { name: 'KBadge', to: { name: 'badge' } },
{ name: 'KButton', to: { name: 'button' } },
{ name: 'KCard', to: { name: 'card' } },
{ name: 'KCatalog', to: { name: 'catalog' } },
{ name: 'KCheckbox', to: { name: 'checkbox' } },
{ name: 'KDropdown', to: { name: 'dropdown' } },
{ name: 'KInput', to: { name: 'input' } },
+ { name: 'KInputSwitch', to: { name: 'inputswitch' } },
{ name: 'KLabel', to: { name: 'label' } },
{ name: 'KMultiselect', to: { name: 'multiselect' } },
{ name: 'KRadio', to: { name: 'radio' } },
diff --git a/sandbox/pages/SandboxBadge.vue b/sandbox/pages/SandboxBadge.vue
new file mode 100644
index 0000000000..d5a459bdd7
--- /dev/null
+++ b/sandbox/pages/SandboxBadge.vue
@@ -0,0 +1,434 @@
+
+
+