-
-
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.
[Joy] Add button loading functionality (#34658)
- Loading branch information
1 parent
13ff52c
commit daed91d
Showing
12 changed files
with
330 additions
and
6 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
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> | ||
); | ||
} |
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> | ||
); | ||
} |
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,22 @@ | ||
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 ButtonLoadingPosition() { | ||
return ( | ||
<Stack spacing={2} direction="row"> | ||
<Button loading loadingPosition="start" variant="outlined"> | ||
Fetch data | ||
</Button> | ||
<Button | ||
loading | ||
loadingPosition="end" | ||
endDecorator={<SendIcon />} | ||
variant="solid" | ||
> | ||
Send | ||
</Button> | ||
</Stack> | ||
); | ||
} |
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,22 @@ | ||
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 ButtonLoadingPosition() { | ||
return ( | ||
<Stack spacing={2} direction="row"> | ||
<Button loading loadingPosition="start" variant="outlined"> | ||
Fetch data | ||
</Button> | ||
<Button | ||
loading | ||
loadingPosition="end" | ||
endDecorator={<SendIcon />} | ||
variant="solid" | ||
> | ||
Send | ||
</Button> | ||
</Stack> | ||
); | ||
} |
11 changes: 11 additions & 0 deletions
11
docs/data/joy/components/button/ButtonLoadingPosition.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,11 @@ | ||
<Button loading loadingPosition="start" variant="outlined"> | ||
Fetch data | ||
</Button> | ||
<Button | ||
loading | ||
loadingPosition="end" | ||
endDecorator={<SendIcon />} | ||
variant="solid" | ||
> | ||
Send | ||
</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
Oops, something went wrong.