-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Revise and expand Joy UI Button doc (#35737)
- Loading branch information
1 parent
e75eb4b
commit 401c104
Showing
15 changed files
with
206 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from 'react'; | ||
import Button from '@mui/joy/Button'; | ||
import Box from '@mui/joy/Box'; | ||
|
||
export default function BasicButtons() { | ||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}> | ||
<Button>Button</Button> | ||
<Button disabled>Disabled</Button> | ||
<Button loading>Loading</Button> | ||
</Box> | ||
); | ||
} |
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,13 @@ | ||
import * as React from 'react'; | ||
import Button from '@mui/joy/Button'; | ||
import Box from '@mui/joy/Box'; | ||
|
||
export default function BasicButtons() { | ||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}> | ||
<Button>Button</Button> | ||
<Button disabled>Disabled</Button> | ||
<Button loading>Loading</Button> | ||
</Box> | ||
); | ||
} |
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,3 @@ | ||
<Button>Button</Button> | ||
<Button disabled>Disabled</Button> | ||
<Button loading>Loading</Button> |
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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/joy/Stack'; | ||
import SendIcon from '@mui/icons-material/Send'; | ||
import Box from '@mui/joy/Box'; | ||
import Button from '@mui/joy/Button'; | ||
|
||
export default function ButtonLoading() { | ||
export default function LoadingButtons() { | ||
return ( | ||
<Stack spacing={2} direction="row"> | ||
<Button loading endDecorator={<SendIcon />} variant="solid"> | ||
Send | ||
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}> | ||
<Button loading variant="solid"> | ||
Solid | ||
</Button> | ||
<Button loading loadingIndicator="Loading…" variant="outlined"> | ||
Fetch data | ||
<Button loading variant="soft"> | ||
Soft | ||
</Button> | ||
</Stack> | ||
<Button loading variant="outlined"> | ||
Outlined | ||
</Button> | ||
<Button loading variant="plain"> | ||
Plain | ||
</Button> | ||
</Box> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/joy/Stack'; | ||
import SendIcon from '@mui/icons-material/Send'; | ||
import Box from '@mui/joy/Box'; | ||
import Button from '@mui/joy/Button'; | ||
|
||
export default function ButtonLoading() { | ||
export default function LoadingButtons() { | ||
return ( | ||
<Stack spacing={2} direction="row"> | ||
<Button loading endDecorator={<SendIcon />} variant="solid"> | ||
Send | ||
<Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap' }}> | ||
<Button loading variant="solid"> | ||
Solid | ||
</Button> | ||
<Button loading loadingIndicator="Loading…" variant="outlined"> | ||
Fetch data | ||
<Button loading variant="soft"> | ||
Soft | ||
</Button> | ||
</Stack> | ||
<Button loading variant="outlined"> | ||
Outlined | ||
</Button> | ||
<Button loading variant="plain"> | ||
Plain | ||
</Button> | ||
</Box> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
<Button loading endDecorator={<SendIcon />} variant="solid"> | ||
Send | ||
<Button loading variant="solid"> | ||
Solid | ||
</Button> | ||
<Button loading loadingIndicator="Loading…" variant="outlined"> | ||
Fetch data | ||
<Button loading variant="soft"> | ||
Soft | ||
</Button> | ||
<Button loading variant="outlined"> | ||
Outlined | ||
</Button> | ||
<Button loading variant="plain"> | ||
Plain | ||
</Button> |
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,17 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/joy/Stack'; | ||
import SendIcon from '@mui/icons-material/Send'; | ||
import Button from '@mui/joy/Button'; | ||
|
||
export default function ButtonLoading() { | ||
return ( | ||
<Stack spacing={2} direction="row"> | ||
<Button loading endDecorator={<SendIcon />} variant="solid"> | ||
Send | ||
</Button> | ||
<Button loading loadingIndicator="Loading…" variant="outlined"> | ||
Fetch data | ||
</Button> | ||
</Stack> | ||
); | ||
} |
17 changes: 17 additions & 0 deletions
17
docs/data/joy/components/button/ButtonLoadingIndicator.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,17 @@ | ||
import * as React from 'react'; | ||
import Stack from '@mui/joy/Stack'; | ||
import SendIcon from '@mui/icons-material/Send'; | ||
import Button from '@mui/joy/Button'; | ||
|
||
export default function ButtonLoading() { | ||
return ( | ||
<Stack spacing={2} direction="row"> | ||
<Button loading endDecorator={<SendIcon />} variant="solid"> | ||
Send | ||
</Button> | ||
<Button loading loadingIndicator="Loading…" variant="outlined"> | ||
Fetch data | ||
</Button> | ||
</Stack> | ||
); | ||
} |
6 changes: 6 additions & 0 deletions
6
docs/data/joy/components/button/ButtonLoadingIndicator.tsx.preview
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,6 @@ | ||
<Button loading endDecorator={<SendIcon />} variant="solid"> | ||
Send | ||
</Button> | ||
<Button loading loadingIndicator="Loading…" variant="outlined"> | ||
Fetch data | ||
</Button> |
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,12 @@ | ||
import * as React from 'react'; | ||
import Button from '@mui/joy/Button'; | ||
import Box from '@mui/joy/Box'; | ||
|
||
export default function UnstyledButtonsSimple() { | ||
return ( | ||
<Box> | ||
<Button>Button</Button> | ||
<Button disabled>Disabled</Button> | ||
</Box> | ||
); | ||
} |
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,2 @@ | ||
<Button>Button</Button> | ||
<Button disabled>Disabled</Button> |
Oops, something went wrong.