-
-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added component files + props, tests, stories, examples fix #1017
- Loading branch information
Showing
19 changed files
with
556 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: React Lists - Flowbite | ||
description: Use the list component to show an unordred or ordered list of items based on multiple styles, layouts, and variants built with Tailwind CSS and Flowbite | ||
--- | ||
|
||
Get started with a collection of list components built with Tailwind CSS for ordered and unordered lists with bullets, numbers, or icons and other styles and layouts to show a list of items inside an article or throughout your web page. | ||
|
||
Start using the list component by first importing it from Flowbite React: | ||
|
||
```jsx | ||
import { List } from 'flowbite-react'; | ||
``` | ||
|
||
## Default list | ||
|
||
Use this example to create a default unordered list of items using the `List` component with `List.Item` child components inside of it. | ||
|
||
<Example name="list.root" /> | ||
|
||
## Nested | ||
|
||
Use this example to nested another list of items inside the parent list element. | ||
|
||
<Example name="list.nested" /> | ||
|
||
## Unstyled | ||
|
||
Use the `unstyled` prop to disable the list style bullets or numbers. | ||
|
||
<Example name="list.unstyled" /> | ||
|
||
## Ordered list | ||
|
||
Use the `ordered` prop tag to create an ordered list of items with numbers. | ||
|
||
<Example name="list.ordered" /> | ||
|
||
## Theme | ||
|
||
To learn more about how to customize the appearance of components, please see the [Theme docs](/docs/customize/theme). | ||
|
||
<Theme name="list" /> | ||
|
||
## References | ||
|
||
- [Flowbite List](https://flowbite.com/docs/typography/list/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export { root } from './list.root'; | ||
export { unstyled } from './list.unstyled'; | ||
export { nested } from './list.nested'; | ||
export { ordered } from './list.ordered'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { type CodeData } from '~/components/code-demo'; | ||
import { List, ListItem } from '~/src'; | ||
|
||
const code = ` | ||
'use client'; | ||
import { List } from 'flowbite-react'; | ||
function Component() { | ||
return ( | ||
<> | ||
<List> | ||
<List.Item>At least 10 characters (and up to 100 characters)</List.Item> | ||
<List.Item>At least one lowercase character</List.Item> | ||
<List.Item>Inclusion of at least one special character, e.g., ! @ # ?</List.Item> | ||
</List> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
const codeRSC = ` | ||
import { List, ListItem } from 'flowbite-react'; | ||
function Component() { | ||
return ( | ||
<> | ||
<List> | ||
<ListItem>At least 10 characters (and up to 100 characters)</ListItem> | ||
<ListItem>At least one lowercase character</ListItem> | ||
<ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> | ||
</List> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<> | ||
<List> | ||
<ListItem> | ||
List item one | ||
<List ordered nested> | ||
<ListItem>You might feel like you are being really "organized" o</ListItem> | ||
<ListItem>Nested navigation in UIs is a bad idea too, keep things as flat as possible.</ListItem> | ||
<ListItem>Nesting tons of folders in your source code is also not helpful.</ListItem> | ||
</List> | ||
</ListItem> | ||
<ListItem> | ||
List item two | ||
<List ordered nested> | ||
<ListItem>I'm not sure if we'll bother styling more than two levels deep.</ListItem> | ||
<ListItem>Two is already too much, three is guaranteed to be a bad idea.</ListItem> | ||
<ListItem>If you nest four levels deep you belong in prison.</ListItem> | ||
</List> | ||
</ListItem> | ||
<ListItem> | ||
List item three | ||
<List ordered nested> | ||
<ListItem>Again please don't nest lists if you want</ListItem> | ||
<ListItem>Nobody wants to look at this.</ListItem> | ||
<ListItem>I'm upset that we even have to bother styling this.</ListItem> | ||
</List> | ||
</ListItem> | ||
</List> | ||
</> | ||
); | ||
} | ||
|
||
export const nested: CodeData = { | ||
type: 'single', | ||
code: [ | ||
{ | ||
fileName: 'client', | ||
language: 'tsx', | ||
code, | ||
}, | ||
{ | ||
fileName: 'server', | ||
language: 'tsx', | ||
code: codeRSC, | ||
}, | ||
], | ||
githubSlug: 'list/list.nested.tsx', | ||
component: <Component />, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { type CodeData } from '~/components/code-demo'; | ||
import { List, ListItem } from '~/src'; | ||
|
||
const code = ` | ||
'use client'; | ||
import { List } from 'flowbite-react'; | ||
function Component() { | ||
return ( | ||
<> | ||
<List ordered> | ||
<List.Item>At least 10 characters (and up to 100 characters)</List.Item> | ||
<List.Item>At least one lowercase character</List.Item> | ||
<List.Item>Inclusion of at least one special character, e.g., ! @ # ?</List.Item> | ||
</List> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
const codeRSC = ` | ||
import { List, ListItem } from 'flowbite-react'; | ||
function Component() { | ||
return ( | ||
<> | ||
<List ordered> | ||
<ListItem>At least 10 characters (and up to 100 characters)</ListItem> | ||
<ListItem>At least one lowercase character</ListItem> | ||
<ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> | ||
</List> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<> | ||
<List ordered> | ||
<ListItem>At least 10 characters (and up to 100 characters)</ListItem> | ||
<ListItem>At least one lowercase character</ListItem> | ||
<ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> | ||
</List> | ||
</> | ||
); | ||
} | ||
|
||
export const ordered: CodeData = { | ||
type: 'single', | ||
code: [ | ||
{ | ||
fileName: 'client', | ||
language: 'tsx', | ||
code, | ||
}, | ||
{ | ||
fileName: 'server', | ||
language: 'tsx', | ||
code: codeRSC, | ||
}, | ||
], | ||
githubSlug: 'list/list.ordered.tsx', | ||
component: <Component />, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { type CodeData } from '~/components/code-demo'; | ||
import { List, ListItem } from '~/src'; | ||
|
||
const code = ` | ||
'use client'; | ||
import { List } from 'flowbite-react'; | ||
function Component() { | ||
return ( | ||
<> | ||
<List> | ||
<List.Item>At least 10 characters (and up to 100 characters)</List.Item> | ||
<List.Item>At least one lowercase character</List.Item> | ||
<List.Item>Inclusion of at least one special character, e.g., ! @ # ?</List.Item> | ||
</List> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
const codeRSC = ` | ||
import { List, ListItem } from 'flowbite-react'; | ||
function Component() { | ||
return ( | ||
<> | ||
<List> | ||
<ListItem>At least 10 characters (and up to 100 characters)</ListItem> | ||
<ListItem>At least one lowercase character</ListItem> | ||
<ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> | ||
</List> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<> | ||
<List> | ||
<ListItem>At least 10 characters (and up to 100 characters)</ListItem> | ||
<ListItem>At least one lowercase character</ListItem> | ||
<ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> | ||
</List> | ||
</> | ||
); | ||
} | ||
|
||
export const root: CodeData = { | ||
type: 'single', | ||
code: [ | ||
{ | ||
fileName: 'client', | ||
language: 'tsx', | ||
code, | ||
}, | ||
{ | ||
fileName: 'server', | ||
language: 'tsx', | ||
code: codeRSC, | ||
}, | ||
], | ||
githubSlug: 'list/list.root.tsx', | ||
component: <Component />, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { type CodeData } from '~/components/code-demo'; | ||
import { List, ListItem } from '~/src'; | ||
|
||
const code = ` | ||
'use client'; | ||
import { List } from 'flowbite-react'; | ||
function Component() { | ||
return ( | ||
<> | ||
<List unstyled> | ||
<List.Item>At least 10 characters (and up to 100 characters)</List.Item> | ||
<List.Item>At least one lowercase character</List.Item> | ||
<List.Item>Inclusion of at least one special character, e.g., ! @ # ?</List.Item> | ||
</List> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
const codeRSC = ` | ||
import { List, ListItem } from 'flowbite-react'; | ||
function Component() { | ||
return ( | ||
<> | ||
<List unstyled> | ||
<ListItem>At least 10 characters (and up to 100 characters)</ListItem> | ||
<ListItem>At least one lowercase character</ListItem> | ||
<ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> | ||
</List> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
function Component() { | ||
return ( | ||
<> | ||
<List unstyled> | ||
<ListItem>At least 10 characters (and up to 100 characters)</ListItem> | ||
<ListItem>At least one lowercase character</ListItem> | ||
<ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> | ||
</List> | ||
</> | ||
); | ||
} | ||
|
||
export const unstyled: CodeData = { | ||
type: 'single', | ||
code: [ | ||
{ | ||
fileName: 'client', | ||
language: 'tsx', | ||
code, | ||
}, | ||
{ | ||
fileName: 'server', | ||
language: 'tsx', | ||
code: codeRSC, | ||
}, | ||
], | ||
githubSlug: 'list/list.unstyled.tsx', | ||
component: <Component />, | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.