diff --git a/apps/docs/content/components/badge/index.ts b/apps/docs/content/components/badge/index.ts
index 147da069d1..0168202550 100644
--- a/apps/docs/content/components/badge/index.ts
+++ b/apps/docs/content/components/badge/index.ts
@@ -6,7 +6,7 @@ import placements from "./placements";
import shapes from "./shapes";
import visibility from "./visibility";
import contentExamples from "./content-examples";
-import disableOutline from "./disable-outline";
+import showOutline from "./show-outline";
import a11y from "./a11y";
export const badgeContent = {
@@ -18,6 +18,6 @@ export const badgeContent = {
shapes,
visibility,
contentExamples,
- disableOutline,
+ showOutline,
a11y,
};
diff --git a/apps/docs/content/components/badge/disable-outline.ts b/apps/docs/content/components/badge/show-outline.ts
similarity index 77%
rename from apps/docs/content/components/badge/disable-outline.ts
rename to apps/docs/content/components/badge/show-outline.ts
index 2adbe419b4..d11a8860bf 100644
--- a/apps/docs/content/components/badge/disable-outline.ts
+++ b/apps/docs/content/components/badge/show-outline.ts
@@ -3,14 +3,14 @@ const App = `import {Badge, Avatar} from "@nextui-org/react";
export default function App() {
return (
-
+
-
+
+
## Import
@@ -62,9 +62,9 @@ You can control the visibility of the badge by using the `isInvisible` property.
### Disable Outline
-By default, the badge has an outline, you can disable it by using the `disableOutline` property.
+By default, the badge has an outline, you can disable it by using the `showOutline={false}` property.
-
+
### Accessibility
@@ -79,18 +79,19 @@ Instead, consider supplying a comprehensive description, such as using `aria-lab
### Badge Props
-| Attribute | Type | Description | Default |
-| ---------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ----------- |
-| children \* | `ReactNode` | The wrapped component. | - |
-| content | `string` \| `number` \| `ReactNode` | The content of the badge. The badge will be rendered relative to its children. | - |
-| variant | `solid` \| `flat` \| `faded` \| `shadow` | The variant style of the badge. | `solid` |
-| color | `default` \| `primary` \| `secondary` \| `success` \| `warning` \| `danger` | The color of the badge. | `default` |
-| size | `sm` \| `md` \| `lg` | The size of the badge. | `md` |
-| shape | `circle` \| `rectangle` | The shape of the badge. | `rectangle` |
-| placement | `top-right` \| `top-left` \| `bottom-right` \| `bottom-left` | The placement of the badge. | `top-right` |
-| disableOutline | `boolean` | If `true`, the badge will not have an outline. | `false` |
-| disableAnimation | `boolean` | If `true`, the badge will not have an animation. | `false` |
-| isInvisible | `boolean` | If `true`, the badge will be invisible. | `false` |
-| isOneChar | `boolean` | If `true`, the badge will have the same width and height. | `false` |
-| isDot | `boolean` | If `true`, the badge will have smaller dimensions. | `false` |
-| classNames | `Record<"base"|"badge", string>` | Allows to set custom class names for the badge slots. | - |
+| Attribute | Type | Description | Default |
+| ---------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ----------- |
+| children \* | `ReactNode` | The wrapped component. | - |
+| content | `string` \| `number` \| `ReactNode` | The content of the badge. The badge will be rendered relative to its children. | - |
+| variant | `solid` \| `flat` \| `faded` \| `shadow` | The variant style of the badge. | `solid` |
+| color | `default` \| `primary` \| `secondary` \| `success` \| `warning` \| `danger` | The color of the badge. | `default` |
+| size | `sm` \| `md` \| `lg` | The size of the badge. | `md` |
+| shape | `circle` \| `rectangle` | The shape of the badge. | `rectangle` |
+| placement | `top-right` \| `top-left` \| `bottom-right` \| `bottom-left` | The placement of the badge. | `top-right` |
+| showOutline | `boolean` | If `true`, the badge will have an outline. | `true` |
+| disableOutline | `boolean` | If `true`, the badge will not have an outline. **Deprecated** use `showOutline` instead. | `false` |
+| disableAnimation | `boolean` | If `true`, the badge will not have an animation. | `false` |
+| isInvisible | `boolean` | If `true`, the badge will be invisible. | `false` |
+| isOneChar | `boolean` | If `true`, the badge will have the same width and height. | `false` |
+| isDot | `boolean` | If `true`, the badge will have smaller dimensions. | `false` |
+| classNames | `Record<"base"|"badge", string>` | Allows to set custom class names for the badge slots. | - |
diff --git a/packages/components/badge/src/use-badge.ts b/packages/components/badge/src/use-badge.ts
index faddd6e2e6..f7dffc28d2 100644
--- a/packages/components/badge/src/use-badge.ts
+++ b/packages/components/badge/src/use-badge.ts
@@ -21,6 +21,12 @@ interface Props extends HTMLNextUIProps<"span", "content"> {
* The content of the badge. The badge will be rendered relative to its children.
*/
content?: string | number | ReactNode;
+ /**
+ * Whether to disable the outline around the badge.
+ * @deprecated use `showOutline` instead
+ * @default false
+ */
+ disableOutline?: boolean;
/**
* Classname or List of classes to change the classNames of the element.
* if `className` is passed, it will be added to the base slot.
@@ -58,6 +64,9 @@ export function useBadge(originalProps: UseBadgeProps) {
() =>
badge({
...variantProps,
+ showOutline: !!originalProps?.disableOutline
+ ? !originalProps?.disableOutline
+ : originalProps?.showOutline,
isOneChar,
isDot,
}),
diff --git a/packages/components/slider/__tests__/slider.test.tsx b/packages/components/slider/__tests__/slider.test.tsx
index 3a08081d06..9649cd7ee7 100644
--- a/packages/components/slider/__tests__/slider.test.tsx
+++ b/packages/components/slider/__tests__/slider.test.tsx
@@ -16,4 +16,12 @@ describe("Slider", () => {
render();
expect(ref.current).not.toBeNull();
});
+
+ it("should support aria-label", () => {
+ const {getByRole} = render();
+
+ const group = getByRole("group");
+
+ expect(group).toHaveAttribute("aria-label", "Aria Label");
+ });
});
diff --git a/packages/components/slider/package.json b/packages/components/slider/package.json
index 8f4ba3266e..af941f7362 100644
--- a/packages/components/slider/package.json
+++ b/packages/components/slider/package.json
@@ -49,9 +49,9 @@
"@react-aria/utils": "^3.20.0",
"@react-aria/visually-hidden": "^3.8.4",
"@react-stately/slider": "^3.4.2"
-
},
"devDependencies": {
+ "@nextui-org/shared-icons": "workspace:*",
"clean-package": "2.2.0",
"react": "^18.0.0"
},
diff --git a/packages/components/slider/src/index.ts b/packages/components/slider/src/index.ts
index c50eff42fa..edb2d670ac 100644
--- a/packages/components/slider/src/index.ts
+++ b/packages/components/slider/src/index.ts
@@ -2,6 +2,7 @@ import Slider from "./slider";
// export types
export type {SliderProps} from "./slider";
+export type {SliderValue} from "./use-slider";
// export hooks
export {useSlider} from "./use-slider";
diff --git a/packages/components/slider/src/slider.tsx b/packages/components/slider/src/slider.tsx
index d929041e88..7b15a12dcc 100644
--- a/packages/components/slider/src/slider.tsx
+++ b/packages/components/slider/src/slider.tsx
@@ -3,7 +3,7 @@ import {forwardRef} from "@nextui-org/system";
import Thumb from "./slider-thumb";
import {UseSliderProps, useSlider} from "./use-slider";
-export interface SliderProps extends UseSliderProps {}
+export interface SliderProps extends Omit {}
const Slider = forwardRef<"div", SliderProps>((props, ref) => {
const {
@@ -11,14 +11,19 @@ const Slider = forwardRef<"div", SliderProps>((props, ref) => {
state,
label,
steps,
+ startContent,
+ endContent,
getStepProps,
getBaseProps,
+ getTrackWrapperProps,
getLabelWrapperProps,
getLabelProps,
getOutputProps,
getTrackProps,
getFillerProps,
getThumbProps,
+ getStartContentProps,
+ getEndContentProps,
} = useSlider({...props, ref});
return (
@@ -29,13 +34,17 @@ const Slider = forwardRef<"div", SliderProps>((props, ref) => {