diff --git a/app/docs/components/button/button.mdx b/app/docs/components/button/button.mdx index d6ed3d0aa..134b71f42 100644 --- a/app/docs/components/button/button.mdx +++ b/app/docs/components/button/button.mdx @@ -1,6 +1,7 @@ import { CodePreview } from '~/app/components/code-preview'; import { Button, theme } from '~/src'; import { HiOutlineArrowRight, HiShoppingCart } from 'react-icons/hi'; +import Link from 'next/link'; The button component is a common UI component found on the web that allows users to trigger certain actions on your website such as submitting a form, navigating to a new page, or downloading a file. @@ -203,6 +204,39 @@ You can disable the button by adding the `disabled` property to the ` +## Override Button base component + +The `as` prop provides you the ability to transform the ` + +
+ +
+`} +> +
+
+ +
+
+ +
+
+ + ## Theme To learn more about how to customize the appearance of components, please see the [Theme docs](/docs/customize/theme). diff --git a/src/components/Button/Button.spec.tsx b/src/components/Button/Button.spec.tsx index 3d931cf4a..83cf38479 100644 --- a/src/components/Button/Button.spec.tsx +++ b/src/components/Button/Button.spec.tsx @@ -1,5 +1,6 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import type { PropsWithChildren } from 'react'; import { describe, expect, it, vi } from 'vitest'; import { Flowbite } from '../../'; import { Button } from './Button'; @@ -98,10 +99,51 @@ describe('Components / Button', () => { expect(button()).toHaveTextContent('Something or other'); }); - it('should render an anchor `` when `href=".."`', () => { - render(