forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Separate ButtonGroup and Fab pages from Button page (mui#19381)
- Loading branch information
1 parent
aa4da69
commit 20c4703
Showing
30 changed files
with
330 additions
and
165 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
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
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,14 @@ | ||
import React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
|
||
const req = require.context('docs/src/pages/components/button-group', false, /\.(md|js|tsx)$/); | ||
const reqSource = require.context( | ||
'!raw-loader!../../src/pages/components/button-group', | ||
false, | ||
/\.(js|tsx)$/, | ||
); | ||
const reqPrefix = 'pages/components/button-group'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs req={req} reqSource={reqSource} reqPrefix={reqPrefix} />; | ||
} |
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,18 @@ | ||
import React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
|
||
const req = require.context( | ||
'docs/src/pages/components/floating-action-button', | ||
false, | ||
/\.(md|js|tsx)$/, | ||
); | ||
const reqSource = require.context( | ||
'!raw-loader!../../src/pages/components/floating-action-button', | ||
false, | ||
/\.(js|tsx)$/, | ||
); | ||
const reqPrefix = 'pages/components/floating-action-button'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs req={req} reqSource={reqSource} reqPrefix={reqPrefix} />; | ||
} |
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
51 changes: 51 additions & 0 deletions
51
docs/src/pages/components/button-group/GroupOrientation.js
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,51 @@ | ||
import React from 'react'; | ||
import Button from '@material-ui/core/Button'; | ||
import ButtonGroup from '@material-ui/core/ButtonGroup'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
root: { | ||
display: 'flex', | ||
'& > *': { | ||
margin: theme.spacing(1), | ||
}, | ||
}, | ||
})); | ||
|
||
export default function GroupOrientation() { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<ButtonGroup | ||
orientation="vertical" | ||
color="primary" | ||
aria-label="vertical outlined primary button group" | ||
> | ||
<Button>One</Button> | ||
<Button>Two</Button> | ||
<Button>Three</Button> | ||
</ButtonGroup> | ||
<ButtonGroup | ||
orientation="vertical" | ||
color="primary" | ||
aria-label="vertical contained primary button group" | ||
variant="contained" | ||
> | ||
<Button>One</Button> | ||
<Button>Two</Button> | ||
<Button>Three</Button> | ||
</ButtonGroup> | ||
<ButtonGroup | ||
orientation="vertical" | ||
color="primary" | ||
aria-label="vertical contained primary button group" | ||
variant="text" | ||
> | ||
<Button>One</Button> | ||
<Button>Two</Button> | ||
<Button>Three</Button> | ||
</ButtonGroup> | ||
</div> | ||
); | ||
} |
51 changes: 51 additions & 0 deletions
51
docs/src/pages/components/button-group/GroupOrientation.tsx
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,51 @@ | ||
import React from 'react'; | ||
import Button from '@material-ui/core/Button'; | ||
import ButtonGroup from '@material-ui/core/ButtonGroup'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
root: { | ||
display: 'flex', | ||
'& > *': { | ||
margin: theme.spacing(1), | ||
}, | ||
}, | ||
})); | ||
|
||
export default function GroupOrientation() { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<ButtonGroup | ||
orientation="vertical" | ||
color="primary" | ||
aria-label="vertical outlined primary button group" | ||
> | ||
<Button>One</Button> | ||
<Button>Two</Button> | ||
<Button>Three</Button> | ||
</ButtonGroup> | ||
<ButtonGroup | ||
orientation="vertical" | ||
color="primary" | ||
aria-label="vertical contained primary button group" | ||
variant="contained" | ||
> | ||
<Button>One</Button> | ||
<Button>Two</Button> | ||
<Button>Three</Button> | ||
</ButtonGroup> | ||
<ButtonGroup | ||
orientation="vertical" | ||
color="primary" | ||
aria-label="vertical contained primary button group" | ||
variant="text" | ||
> | ||
<Button>One</Button> | ||
<Button>Two</Button> | ||
<Button>Three</Button> | ||
</ButtonGroup> | ||
</div> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,26 @@ | ||
--- | ||
title: ButtonGroup React component | ||
components: Button, ButtonGroup | ||
--- | ||
|
||
# Button group | ||
|
||
<p class="description">The ButtonGroup component can be used to group related buttons.</p> | ||
|
||
## Basic button group | ||
|
||
{{"demo": "pages/components/button-group/BasicButtonGroup.js"}} | ||
|
||
### Group sizes and colors | ||
|
||
{{"demo": "pages/components/button-group/GroupSizesColors.js"}} | ||
|
||
### Group orientation | ||
|
||
{{"demo": "pages/components/button-group/GroupOrientation.js"}} | ||
|
||
### Split Button | ||
|
||
ButtonGroup can also be used to create a split button. The dropdown can change the button action (as in this example), or be used to immediately trigger a related action. | ||
|
||
{{"demo": "pages/components/button-group/SplitButton.js"}} |
File renamed without changes.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.