Skip to content

Commit

Permalink
[docs][joy] Add typography introduction demo component (#37553)
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Ernstberger <[email protected]>
Co-authored-by: Danilo Leal <[email protected]>
  • Loading branch information
sernstberger and danilo-leal authored Jun 9, 2023
1 parent 05b7cdb commit d02960f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
62 changes: 62 additions & 0 deletions docs/data/joy/components/typography/TypographyUsage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import * as React from 'react';
import JoyUsageDemo from 'docs/src/modules/components/JoyUsageDemo';
import Typography from '@mui/joy/Typography';
import { Box } from '@mui/joy';

export default function TypographyUsages() {
return (
<JoyUsageDemo
componentName="Typography"
data={[
{
propName: 'level',
knob: 'select',
defaultValue: 'h1',
options: [
'display1',
'display2',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'body1',
'body2',
'body3',
],
},

{
propName: 'color',
knob: 'color',
defaultValue: 'neutral',
},

{
propName: 'variant',
knob: 'select',
defaultValue: 'plain',
options: ['plain', 'outlined', 'soft', 'solid'],
},

{
propName: 'children',
knob: 'input',
defaultValue: 'Typography',
},

{
propName: 'noWrap',
knob: 'switch',
defaultValue: false,
},
]}
renderDemo={(props) => (
<Box sx={{ maxWidth: '400px' }}>
<Typography {...props}>{props.children}</Typography>
</Box>
)}
/>
);
}
2 changes: 2 additions & 0 deletions docs/data/joy/components/typography/typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ githubLabel: 'component: Typography'

The Typography component helps maintain a consistent design by providing a limited set of values to choose from and convenient props for building common designs faster.

{{"demo": "TypographyUsage.js", "hideToolbar": true, "bg": "gradient"}}

## Basics

```jsx
Expand Down

0 comments on commit d02960f

Please sign in to comment.