You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: improve content of docs and components for #767 (#768)
* docs(styles): improve `<code>` styling
* docs(accordion): improve docs text for `<Accordion />``
* docs(code content): reduce text size
* docs(code-preview): move title outside of code preview component
* docs(alert): update documentation for alerts
* docs(avatar): finish documentation for the `<Avatar>` component
* docs(badges): add unique text and docs for the `<Badge>` component
* docs(code-preview): remove title prop
* docs(breadcrumb): add additional docs and content to the `<Breadcrumb>` component
* docs(buttons): finish docs for buttons page
* docs(button group): finish new docs for button group component
* chore(CNAME): remove CNAME file
* docs(card): add new content for cards documentation
* docs(carousel): update docs for carousel
* docs(dropdown): update content for dropdown component
* docs(footer): add footer content description
* docs(list group): add docs for list group
* docs(navbar): add docs for navbar
* fix(theme): remove weird border styles from navbar by default
* docs(progress): add content and description to progress bar
* docs(rating): finish content writing for rating component
* chore(progress): fix prettier formatting
* docs(sidebar): update sidebar component docs
* docs(sidebar): update default bg color to `gray-50`
* docs(sidebar): finish sidebar docs
* docs(spinner): finish docs for spinner component
* docs(table): finish new docs content for tables
* docs(footer): update footer link colors
* docs(timeline): finish docs for timeline
* docs(toast): add docs content for toast component
* docs(tooltip): finish docs for tooltip
* docs(tabs): add rounded styles to tabs by default
* docs(tabs): add documentation and fix styles
* docs(tabs): add text to all tabs for docs
* docs(tabs): add component with state back in comments for to do
* docs(modal): update modal docs content and fix some spacings
* docs(tabs): add programatically setting tabs component
* docs(pagination): fix docs content for pagination
* docs(pagination): fix prettier warning
* docs(forms): finish documentation for forms
---------
Co-authored-by: Conner Davis <[email protected]>
The accordion component is a collection of vertically collapsing header and body elements that can be used to show and hide information based on the Tailwind CSS utility classes and JavaScript from Flowbite.
4
+
The accordion component from Flowbite React can be used to toggle the visibility of the content of each accordion panel tab by expanding the collapsing the trigger element based on multiple examples and styles.
5
5
6
-
A popular use case would be the “Frequently Asked Questions” section of a website or page when you can show questions and answers for each child element.
6
+
The reactivity and state is handled by React and the components is built using the Tailwind CSS framework meaning that you can easily customize the styles and colors of the accordion.
7
+
8
+
To use the accordion component, you need to import the `<Accordion>` component from `flowbite-react`:
9
+
10
+
```jsx
11
+
'use client';
12
+
13
+
import { Accordion } from'flowbite-react';
14
+
```
15
+
16
+
## Default accordion
17
+
18
+
Use this example of the `<Accordion>` component and the `<Accordion.Panel>` and `<Accordion.Title>` subcomponents to create an accordion with multiple panels.
Copy file name to clipboardexpand all lines: app/docs/components/accordion/page.tsx
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ import AccordionPageContent from '.';
4
4
5
5
exportconstmetadata: Metadata={
6
6
description:
7
-
'Use the accordion component to show hidden information based on the collapse and expand state of the child elements using data attribute options',
7
+
'Use the accordion component and its options to expand and collapse the content inside each panel based on state reactivity from React and Tailwind CSS',
The alert component can be used to provide information to your users such as success or error messages, but also highlighted information complementing the normal flow of paragraphs and headers on a page. Flowbite also includes dismissable alerts which can be hidden by the users by clicking on the close icon.
6
+
The alert component can be used to show a contextual text to the user such as a success or error message after form validation inside an alert box where you can choose from multiple colors, sizes, and styles.
7
+
8
+
The examples below are styled with Tailwind CSS and the reactivity is handled by React and you can also add any type of content inside the alert box.
9
+
10
+
To start using the alert box you need to import the `<Alert>` component from the `flowbite-react` package:
11
+
12
+
```jsx
13
+
'use client';
14
+
15
+
import { Alert } from'flowbite-react';
16
+
```
17
+
18
+
## Default alert
19
+
20
+
The default alert component is a simple alert box with a text inside it and you can use the `color` prop to change the color of the alert box and the `title` prop to add a title to the alert box.
21
+
22
+
Inside of the `<Alert>` component you can add any type of content such as text, images, or other components as they will be considered children of the alert box.
7
23
8
24
<CodePreviewtitle="Default alert">
9
25
<Alertcolor="info">
@@ -12,41 +28,71 @@ The alert component can be used to provide information to your users such as suc
12
28
</span>
13
29
</Alert>
14
30
</CodePreview>
31
+
32
+
## Alert with icon
33
+
34
+
Use the `icon` prop to add an icon to the alert box and you can use any icon from the [React Icons](https://react-icons.github.io/react-icons/) library.
35
+
15
36
<CodePreviewtitle="Alert with icon">
16
37
<Alertcolor="failure"icon={HiInformationCircle}>
17
38
<span>
18
39
<spanclassName="font-medium">Info alert!</span> Change a few things up and try submitting again.
19
40
</span>
20
41
</Alert>
21
42
</CodePreview>
43
+
44
+
## Dismissable alert
45
+
46
+
You can use the `onDismiss` prop on the `<Alert>` component to add a dismiss button to the alert box by adding a function inside of it that will be called when the user clicks on the dismiss button.
Copy file name to clipboardexpand all lines: app/docs/components/alert/page.tsx
+2-1
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,8 @@ import { DocsContentLayout } from '~/app/components/docs-content-layout';
3
3
importAlertPageContentfrom'.';
4
4
5
5
exportconstmetadata: Metadata={
6
-
description: 'Show contextual information to your users using alert elements based on Tailwind CSS',
6
+
description:
7
+
'Get started with the alert component to show contextual information to the user such as when validating forms or showing errors based on React and Tailwind CSS',
0 commit comments