mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
docs(ordered-list): improve docs
This commit is contained in:
parent
b60d0d4f12
commit
297cb64182
1 changed files with 11 additions and 3 deletions
|
@ -7,14 +7,18 @@ components: ["OrderedList", "ListItem"]
|
||||||
import Preview from "../../components/Preview.svelte";
|
import Preview from "../../components/Preview.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
`OrderedList` provides a structured way to display numbered lists of items. It supports nested lists, native browser styles, and expressive typography for enhanced visual hierarchy.
|
||||||
|
|
||||||
<InlineNotification svx-ignore lowContrast title="Tip:" kind="info" hideCloseButton>
|
<InlineNotification svx-ignore lowContrast title="Tip:" kind="info" hideCloseButton>
|
||||||
<div class="body-short-01">
|
<div class="body-short-01">
|
||||||
Consider using the <Link href="/components/RecursiveList#ordered">RecursiveList</Link> component for rendering tree structured data.
|
Consider using the <Link href="/components/RecursiveList#ordered">RecursiveList</Link> component for rendering tree structured data.
|
||||||
</div>
|
</div>
|
||||||
</InlineNotification>
|
</InlineNotification>
|
||||||
|
|
||||||
## Default
|
## Default
|
||||||
|
|
||||||
|
Create a basic ordered list by wrapping `ListItem` components within `OrderedList`.
|
||||||
|
|
||||||
<OrderedList>
|
<OrderedList>
|
||||||
<ListItem>Ordered list item</ListItem>
|
<ListItem>Ordered list item</ListItem>
|
||||||
<ListItem>Ordered list item</ListItem>
|
<ListItem>Ordered list item</ListItem>
|
||||||
|
@ -23,6 +27,8 @@ components: ["OrderedList", "ListItem"]
|
||||||
|
|
||||||
## With links
|
## With links
|
||||||
|
|
||||||
|
Add interactive elements like `Link` components within list items.
|
||||||
|
|
||||||
<OrderedList>
|
<OrderedList>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<Link href="#">Ordered list item</Link>
|
<Link href="#">Ordered list item</Link>
|
||||||
|
@ -37,6 +43,8 @@ components: ["OrderedList", "ListItem"]
|
||||||
|
|
||||||
## Nested
|
## Nested
|
||||||
|
|
||||||
|
Set the `nested` prop to `true` to create hierarchical lists with proper indentation and numbering.
|
||||||
|
|
||||||
<OrderedList>
|
<OrderedList>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
Ordered list level 1
|
Ordered list level 1
|
||||||
|
@ -57,7 +65,7 @@ components: ["OrderedList", "ListItem"]
|
||||||
|
|
||||||
## Native list styles
|
## Native list styles
|
||||||
|
|
||||||
Use the `native` attribute to enable default browser list styles. This is useful for large lists (i.e., 1000 or more items) where the list number may overlap with the list item text.
|
Enable native browser list styles by setting the `native` prop to `true`. This is useful for large lists where the list number may overlap with the list item text.
|
||||||
|
|
||||||
<OrderedList native>
|
<OrderedList native>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
|
@ -79,7 +87,7 @@ Use the `native` attribute to enable default browser list styles. This is useful
|
||||||
|
|
||||||
## Expressive styles
|
## Expressive styles
|
||||||
|
|
||||||
Set `expressive` to `true` to use Carbon's expressive typesetting.
|
Use Carbon's expressive typesetting by setting the `expressive` prop to `true`.
|
||||||
|
|
||||||
<OrderedList expressive>
|
<OrderedList expressive>
|
||||||
<ListItem><Link size="lg" href="#">Ordered list item</Link></ListItem>
|
<ListItem><Link size="lg" href="#">Ordered list item</Link></ListItem>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue