Skip to content

Commit

Permalink
docs: update usage for using as="li" for Text component (#899)
Browse files Browse the repository at this point in the history
  • Loading branch information
trend-alan-bie authored Jul 22, 2024
1 parent bd07350 commit 6872a93
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/react-docs/pages/components/text/index.page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ You can format the `Text` component by passing `fontSize`, `lineHeight`, or othe

{render('./the-as-prop')}

## Commonly Asked Questions

### Show bullet when using as `li` props

The default value for `display` props is `block` which causes the bullet points of list items to disappear. Setting `display="list-item"` will restore their visibility.

{render('./text-as-li')}

## Props

### Text
Expand Down
18 changes: 18 additions & 0 deletions packages/react-docs/pages/components/text/text-as-li.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Text } from '@tonic-ui/react';
import React from 'react';

const App = () => (
<>
<Text as="li" display="list-item">
This is an example with bullet points.
</Text>
<Text as="li" display="list-item">
This is an example with bullet points.
</Text>
<Text as="li" display="list-item">
This is an example with bullet points.
</Text>
</>
);

export default App;

0 comments on commit 6872a93

Please sign in to comment.