1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Improving code formatting in component-library readme (#18910)

This commit is contained in:
George Marshall 2023-05-02 07:50:37 -07:00 committed by GitHub
parent 4d015de43e
commit abd6df72c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,22 +10,22 @@ All components are built on top of the `Box` component and accept all `Box` [com
`component-library` components accept all utility props for layout
```
import { Text } from '../../component-library'
```jsx
import { Text } from '../../component-library';
<Text marginBottom={4}>This text has a margin-bottom of 16px</Text>
<Text marginBottom={4}>This text has a margin-bottom of 16px</Text>;
```
#### Polymorphic `as` prop
`component-library` components accept a polymorphic as prop to change the root html element of a component
```
import { Text } from '../../component-library'
```jsx
import { Text } from '../../component-library';
<ul>
<Text as="li">This renders as list item html element</Text>
</ul>
<Text as="li">This renders as list item html element</Text>
</ul>;
```
## TypeScript